urgent/thisbounty.com-events

Websocket Debounce

Opened this issue · 2 comments

First look for something general with the event, not the websocket:
https://davidwalsh.name/javascript-debounce-function

Don't render socket events one at a time. Debounce, and use ReactDOM.unstable_batchedUpdates()

Make a utility function that accepts event and effect as parameters.

Exponentially back off. Render first one, then second, then ten.

Timeout after 5 seconds.

Batch websocket messages

#3.23

Start off with writing state for 1.

Then just use timeout. Set state for 1. Turn on a flag which uses setTimeout for next ones

Random the interval so site stays snappy.

Then add length to the buffer. At ten render, even if timeout has not been reached.