robtaussig / react-use-websocket

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

reconnectAttempts must be finite #202

Closed JoeFurfaro closed 1 year ago

JoeFurfaro commented 1 year ago

There are many cases where it would be useful to try reconnecting infinite time (on a kiosk, for example). The library does not seem to properly support this.

I propose allowing reconnectAttempts to be set to -1, meaning infinite attempts to reconnect will be made.

jonschlinkert commented 1 year ago

Doesn't Infinity work?