Document all the events

This commit is contained in:
Amish Shah
2016-08-20 00:15:04 +01:00
parent f8b2629b18
commit 65350348a8
26 changed files with 210 additions and 1 deletions

View File

@@ -182,6 +182,11 @@ class WebSocketManager {
if (unavailableCount === 0) {
this.status = Constants.Status.READY;
/**
* Emitted when the Client becomes ready to start working
*
* @event Client#ready
*/
this.client.emit(Constants.Events.READY);
this.packetManager.handleQueue();
}
@@ -196,6 +201,11 @@ class WebSocketManager {
this.status = Constants.Status.RECONNECTING;
this.ws.close();
this.packetManager.handleQueue();
/**
* Emitted when the Client tries to reconnect after being disconnected
*
* @event Client#reconnecting
*/
this.client.emit(Constants.Events.RECONNECTING);
this.connect(this.client.ws.gateway);
}