Skip to content

Commit

Permalink
fix: expose WebSocket close event (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: ZackFan <[email protected]>
  • Loading branch information
kevinypfan and kevinypfan authored Jun 30, 2023
1 parent 3be65d5 commit f4ae32a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/websocket/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class WebSocketClient extends events.EventEmitter {
this.socket.onopen = () => this.emit(CONNECT_EVENT);
this.socket.onmessage = event => this.emit(MESSAGE_EVENT, event.data);
this.socket.onerror = event => this.emit(ERROR_EVENT, event.error);
this.socket.onclose = () => this.emit(DISCONNECT_EVENT);
this.socket.onclose = event => this.emit(DISCONNECT_EVENT, event);
this.on(CONNECT_EVENT, () => this.authenticate());
this.on(MESSAGE_EVENT, message => this.handleMessage(message));

Expand Down

0 comments on commit f4ae32a

Please sign in to comment.