Rename connected and dropped events

Rename the connector events connected and dropped to connect and drop
respectively to be consistent with common Node.js names for events like
close.
This commit is contained in:
Hornwitser committed 2020-05-07 12:36:43 +02:00
1 parent 1629eaf225
commit 5c1214ad38
4 files changed
+14 -14

No files matched your search

+4 -4
View File
@@ -199,7 +199,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
this._doConnect();
// Wait for the connection to be ready
await events.once(this, "connected");
await events.once(this, "connect");
}
async _doConnect() {
@@ -275,7 +275,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
} else {
this._state = "handshake";
this.reconnect();
this.emit("dropped");
this.emit("drop");
}
this.stopHeartbeat();
@@ -361,7 +361,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
this.startHeartbeat();
this._startedReconnect = null;
this._connected = true;
this.emit("connected");
this.emit("connect");
} else if (type === "continue") {
console.log("SOCKET | resuming existing session");
@@ -374,7 +374,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
}
this._startedReconnect = null;
this._connected = true;
this.emit("connected");
this.emit("connect");
} else if (type === "invalidate") {
this._heartbeatInterval = null;