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 authored and hwillson committed Aug 10, 2020
1 parent 4af30a5 commit 1ed7bca
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 @@ -167,6 +167,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 1ed7bca

Please sign in to comment.