joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects
MIT License
4.21k stars 968 forks source link

Added option for maxReconnectInterval #35

Open JamesThorpe opened 9 years ago

JamesThorpe commented 9 years ago

Added an extra option to specify the maximum amount of time to wait before attempting a reconnect. Defaults to -1, to keep the current behaviour.

joewalnes commented 9 years ago

Thanks.

Rather than -1, I think a good sensible default will be something like 30000. Seems like more useful behavior and it makes it simpler for users to understand (no need to worry about magic numbers).

Please include the description of this option in the header of the JS and README

JamesThorpe commented 9 years ago

Great, will do. Also noticed that it may need to be documented in the .ts file as well?

joewalnes commented 9 years ago

uhhh actually I forgot about the .ts file. Yeah, that needs to be updated too. In fact, some other recent changes have been left out from that file. I suggest doing that as a separate pull-request. If you have questions about the .ts stuff, ask @drewnoakes