redux-batched-updates
v0.1.0
Published
Batch React updates that occur as a result of Redux dispatches.
Downloads
2,329
Maintainers
Readme
redux-batched-updates
Batch React updates that occur as a result of Redux dispatches, to prevent cascading renders. See https://github.com/gaearon/redux/issues/125 for more details.
npm install --save redux-batched-updates
Usage
// Use as higher-order store
import { batchedUpdates } from 'redux-batched-updates';
const store = batchedUpdates(createStore)(reducer, intialState);
// Or as middleware
import { batchedUpdatesMiddleware } from 'redux-batched-updates';
const m = composeMiddleware(thunk, promise, batchedUpdatesMiddleware);
const store = applyMiddleware(m)(createStore)(reducer, initialState)