Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
canvas
/
node_modules
/
redux-batch-middleware
/
Filename :
README.md
back
Copy
# redux-batch-middleware > Batch Redux actions [](https://www.npmjs.com/package/redux-batch-middleware) Batch [middleware](http://rackt.github.io/redux/docs/advanced/Middleware.html) for Redux. Inspired by [redux-batched-actions](https://github.com/tshelburne/redux-batched-actions). ## Install ``` npm install --save redux-batch-middleware ``` ## Usage Add as middleware: ```js 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: ```js 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