Skip to content

Is there a reconnected callback? #312

Answered by enisdenjo
theogravity asked this question in Q&A
Discussion options

You must be logged in to vote

There's no need for a specific event. Here's how you can perform the check:

let disconnected = false;
createClient({
  ...
  on: {
    closed: () => {
      disconnected = true;
    },
    connected: () => {
      if (disconnected) {
        // reconnected
      }
    },
  },
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by theogravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants