react-use-websocket icon indicating copy to clipboard operation
react-use-websocket copied to clipboard

Allow custom reconnect behaviour

Open Anntoin opened this issue 3 years ago • 0 comments

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?

Anntoin avatar Nov 05 '21 13:11 Anntoin