Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Statuses #28

Open
Streemo opened this issue Jun 17, 2016 · 0 comments
Open

Multiple Statuses #28

Streemo opened this issue Jun 17, 2016 · 0 comments

Comments

@Streemo
Copy link

Streemo commented Jun 17, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant