1.0.1 • Published 6 years ago

redux-chain-actions v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

#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.