-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Just a suggestion,
Here's one thing I would change:
this.socket.on("close", () => {
/* got rid of auto-disconnect status and emit here */
this.messageQueue.empty();
if (this.autoReconnect) {
this.status = "reconnecting"; /*this status is new.*/
this.emit('reconnecting'); /*this event is new.*/
setTimeout(
this.socket.open.bind(this.socket),
this.reconnectInterval
);
} else { /*this else block is new*/
this.status = "disconnected";
this.emit("disconnected");
}
});
Instead of this.status being binary, it should be ternary, including "connected", "disconnected", and "reconnecting". I am unsure if this goes against the DDP spec, but It would be nice to have.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels