(a part of restate project)
Just delay update propagation. Or debounce. Or Throttle. Why not?
Sometimes store could update rapidly. Much more often than you need. Known solution
to mitigate the problem is named batching
.
For example - redux-batched-subscribe - redux store enhancer to "batch" updates. It just delays the notification of "subscribed" to redux elements, react-redux for example.
Redux-delay is doing absolutely the same, but from react
side.
All the elements and their descendants, wrapped by ReduxDelay will receive redux store updates in batched, or, to be more concrete - debounced way.
; const ThrottledComponent = BaseComponent; const App = <ReduxDelay timeout=200 mode="debounce"> <RestOfApplication /> </ReduxDelay>;
Supported modes - 'debounce', or 'throttle'.
Licence
MIT