You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Make useSubscription return info about the subscription #5786
It's currently pretty difficult to tell whether a subscription is actually connected and listening for events. To track the status of the connection you would have to handle these events yourself. It would be nice if there was an easier way to track the status of the subscription.
Describe the solution you'd like to see
Have the useSubscription hook return the status of the connection.
const{ status }=api.message.useSubscription();if(status!=='connected')return<p>You are currently not connected to the server :(</p>;return<p>Connection active :D</p>;
Describe alternate solutions
Currently to show the user they are not connected to the service I am tracking the online status of the device, but this is only loosely correlated to actual status of the connection. This means that it will always show that the service is available when the device is online even while our service is down.
Additional information
No response
👨👧👦 Contributing
🙋♂️ Yes, I'd be down to file a PR implementing this feature!
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.
Activity
github-actions commentedon Oct 22, 2024
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.