mirror of
https://github.com/wisplite/tether-ts.git
synced 2026-05-01 06:22:41 -05:00
clean up promises when client disconnects
This commit is contained in:
Vendored
+7
@@ -29,6 +29,13 @@ export class TetherClient {
|
||||
}));
|
||||
});
|
||||
};
|
||||
this.websocketHandler.onClose = () => {
|
||||
this.pendingMutations.forEach(pending => {
|
||||
clearTimeout(pending.timeoutId);
|
||||
pending.reject(new Error('Connection closed'));
|
||||
});
|
||||
this.pendingMutations.clear();
|
||||
};
|
||||
};
|
||||
disconnect = () => {
|
||||
this.websocketHandler.close();
|
||||
|
||||
Reference in New Issue
Block a user