Flux Standard Action utlities for Redux
npm install redux-actions



> Flux Standard Action utilities for Redux
- Getting Started
- Installation
- Usage
- Documentation
``bash`
$ npm install --save redux-actions
or
`bash`
$ yarn add redux-actions
The npm package provides ES modules that should be compatible with every modern build tooling.
`js
import { createActions, handleActions, combineActions } from 'redux-actions';
const defaultState = { counter: 10 };
const { increment, decrement } = createActions({
INCREMENT: (amount = 1) => ({ amount }),
DECREMENT: (amount = 1) => ({ amount: -amount })
});
const reducer = handleActions(
{
[combineActions(increment, decrement)]: (
state,
{ payload: { amount } }
) => {
return { ...state, counter: state.counter + amount };
}
},
defaultState
);
export default reducer;
``
See the full API documentation.
- Introduction
- API
- External Resources
- Changelog
- Contributors