How do I bind this
into a socket.on call?
class SocketManager {
constructor( ) {
this.test = 'Test string';
this._Initialize( );
}
this._Initialize( ) {
this.socket = io.connect( );
this.socket.on( 'test', ( ) => {
console.log( this.test ); // Wanted Output: "Test string"
} );
}
}