Closed yoonwaiyan closed 5 years ago
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: https://github.com/lukeed/sockette/issues/43#issuecomment-469861917
Hope that helps!
Hi, I saw from your README that
WebSocket
object is available in eachEventListener
, 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.