Batch Redux actions
Batch middleware for Redux. Inspired by redux-batched-actions.
Using npm.
npm install --save redux-batch-middleware
Using yarn.
yarn add redux-batch-middleware
Add as middleware:
import { applyMiddleware, createStore } from 'redux';
import { batch, batching } from 'redux-batch-middleware';
import reducers from './reducers';
const middleware = [batch];
const store = createStore(batching(root), applyMiddleware(...middleware));;
Dispatch multiple actions:
store.dispatch([action1, action2]);
Redux middleware which converts a dispatched array of actions to a batch action.
Type: function
A reducer that should be able to handle batched actions, most likely the root reducer.
The name of the batch type.
MIT