Package Exports
- redux-batched-subscribe
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-batched-subscribe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
redux-batched-subscribe
Store enhancer for redux which allows batching of subscribe notifications that occur as a result of dispatches.
npm install --save redux-batched-subscribe
Usage
Debounced subscribe handlers:
import { batchedSubscribe } from 'redux-batched-subscribe';
import debounce from 'lodash.debounce';
const batchDebounce = debounce(notify => notify());
const store = batchedSubscribe(batchDebounce)(createStore)(reducer, intialState);
React batched updates
import { batchedSubscribe } from 'redux-batched-subscribe';
// React <= 0.13
import { addons } from 'react/addons';
const batchedUpdates = addons.batchedUpdates;
// React 0.14-beta
import { unstable_batchedUpdates as batchedUpdates } from 'react-dom';
const store = batchedSubscribe(batchedUpdates)(createStore)(reducer, intialState);
This store enhancer also exposes a subscribeImmediate
method which allows for unbatched subscribe notifications.
Thanks
Thanks to Andrew Clark for the clean library structure.