react-use-websocket
react-use-websocket copied to clipboard
Allow custom reconnect behaviour
I like to be able to customise the retry behaviour, e.g. like using a token bucket. Then a client would be able to reconnect immediately for 'normal' websocket connection interruptions but with a persistent error or connection issue the client appropriately throttles it's requests.
I'm thinking this could be accomplished by allowing reconnectInterval
to optionally take a function.
Is this something that would be considered?