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

Possible to get WebSocket instance? #54

Closed
yoonwaiyan opened this issue Jul 23, 2019 · 1 comment
Closed

Possible to get WebSocket instance? #54

yoonwaiyan opened this issue Jul 23, 2019 · 1 comment

Comments

@yoonwaiyan
Copy link

yoonwaiyan commented Jul 23, 2019

Hi, I saw from your README that WebSocket object is available in each EventListener, but is there a way to access it outside of event listeners? Would like to get the state of WebSocket to determine whether to stop an interval to ping the websocket server, thanks.

@lukeed
Copy link
Owner

lukeed commented Jul 23, 2019

Hey!

This has been answered a few times. Because it is available as the event target, you just save a reference manually into a side-effect variable.

Please see the additional answers linked here: #43 (comment)

Hope that helps!

@lukeed lukeed closed this as completed Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants