Skip to content

Multiple Statuses #28

@Streemo

Description

@Streemo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions