Is there a reconnected callback? #312
Answered
by
enisdenjo
theogravity
asked this question in
Q&A
-
We have a case where we want to do something when the client reconnects from a connection being lost, I don't see one in the |
Beta Was this translation helpful? Give feedback.
Answered by
enisdenjo
Feb 20, 2022
Replies: 1 comment
-
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
}
},
},
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
theogravity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no need for a specific event. Here's how you can perform the check: