redux-chain-actions

1.0.1 • Public • Published

redux-chain-actions

redux-chain-actions is a middleware to help us to dispatch action one by one.

Installation

npm install --save redux-chain-actions

Usage

Should add redux-chain-actions middleware when create store

export const first = (first) => ({
 type: 'first',
});

export const second = (second) => ({
 type: 'second',
});

export const chainAction = (params) => ({
 type: 'test',
 payload: [first, second],
});

When we dispatch chainAction, first and second action will be dispatched one by one.

Note

  • This middleware will only handle the action which follow FSA, so it's better to use redux-action library to create your action.
  • The chain action should be action creator, this means it should be function, such as first and second.

Readme

Keywords

none

Package Sidebar

Install

npm i redux-chain-actions

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.08 kB

Total Files

6

Last publish

Collaborators

  • ruda