robtaussig / react-use-websocket

React Hook for WebSocket communication
MIT License
1.63k stars 135 forks source link

Library keep global state for WebSockets are opened in the child window #121

Closed Shokubeni closed 2 years ago

Shokubeni commented 2 years ago

It is proposed to export function 'resetGlobalState' that allows resetting subscribers for a specific URL. There are some cases when that state can't be cleaned by the hook itself. The problem is described in the readme as an example.

robtaussig commented 2 years ago

Thank you @Shokubeni for this and for taking the time to submit a PR along with updating the README. I'll take a closer look later this evening!

robtaussig commented 2 years ago

@Shokubeni Thank you very much for this! Approved, merged, and released to react-use-websocket@3.0.0