Return false from socket handlers to not dispatch action
This commit is contained in:
parent
a4fe18c0f0
commit
a33157ff84
8 changed files with 141 additions and 126 deletions
|
@ -26,7 +26,7 @@ export default class Socket {
|
|||
|
||||
this.ws.onopen = () => {
|
||||
this.connected = true;
|
||||
this.emit('_connected', true);
|
||||
this.emit('connected', { connected: true });
|
||||
clearTimeout(this.timeoutConnect);
|
||||
this.backoff.reset();
|
||||
this.setTimeoutPing();
|
||||
|
@ -35,7 +35,7 @@ export default class Socket {
|
|||
this.ws.onclose = () => {
|
||||
if (this.connected) {
|
||||
this.connected = false;
|
||||
this.emit('_connected', false);
|
||||
this.emit('connected', { connected: false });
|
||||
}
|
||||
clearTimeout(this.timeoutConnect);
|
||||
clearTimeout(this.timeoutPing);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue