Constructors
constructor
- new SocketClient(endpoint: string, options?: any): SocketClient
-
Parameters
-
endpoint: string
-
Optional options: any
Properties
Private _socket
_socket: typeof Socket
Methods
off
- off<TChannel>(channel: TChannel, fn: (response: ResponseByChannel<TChannel>) => unknown): this
-
Type parameters
Parameters
-
channel: TChannel
-
fn: (response: ResponseByChannel<TChannel>) => unknown
-
-
Parameters
Returns unknown
Returns this
offError
- offError(fn: Function): this
on
- on<TChannel>(channel: TChannel, fn: (response: ResponseByChannel<TChannel>) => unknown): this
-
Type parameters
Parameters
-
channel: TChannel
-
fn: (response: ResponseByChannel<TChannel>) => unknown
-
-
Parameters
Returns unknown
Returns this
onConnect
- onConnect(fn: Function): this
onError
- onError(fn: Function): this
subscribe
- subscribe<TChannel>(channel: TChannel, params: ParamsByChannel<TChannel>): this
-
Type parameters
Parameters
Returns this
unsubscribe
- unsubscribe<TChannel>(channel: TChannel, params: ParamsByChannel<TChannel>): this
-
Type parameters
Parameters
Returns this