redux-batch-middleware

0.2.0 • Public • Published

redux-batch-middleware

Batch Redux actions

npm version

Batch middleware for Redux. Inspired by redux-batched-actions.

Install

npm install --save redux-batch-middleware

Usage

Add as middleware:

import { applyMiddleware, createStore } from 'redux';
import { batch, batching } from 'redux-batch-actions';
import reducers from './reducers';
 
const middleware = [batch];
 
const store = applyMiddleware(...middleware)(createStore)(batching(reducers));

Dispatch multiple actions:

store.dispatch([action1, action2]);

API

batch

Redux middleware which converts a dispatched array of actions to a batch action.

batching(reducer)

reducer

Type: function

A reducer that should be able to handle batched actions, most likely the root reducer.

type

The name of the batch type.

License

MIT

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i redux-batch-middleware

    Weekly Downloads

    2,828

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • mrydengren