Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Clear WebSocket event listeners on close.
Browse files Browse the repository at this point in the history
  • Loading branch information
tretne committed Aug 5, 2019
1 parent 8e0d270 commit a0737a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ export class SubscriptionClient {
}

this.client.close();
this.client.onopen = null;
this.client.onclose = null;
this.client.onerror = null;
this.client.onmessage = null;
this.client = null;
this.eventEmitter.emit('disconnected');

Expand Down

0 comments on commit a0737a9

Please sign in to comment.