redux-standard-reducer
A redux reducer for standard action that merge data to state
Install
$ npm i redux-standard-reducer --save
Usage
// suppose all business reducer exits in app/reducers/ // reducer for createStoreconst finalReducer = const store =
enable this reducer
use any one of these:
- make
action.type
starts withSTANDARD_MERGE_STATE
, this reducer will handle the action - make
action.standard = true
, this reducer will handle the action
payload
Action with action = type standard payload: ...
key | type | remark |
---|---|---|
payload |
Object |
the data need to be merged to the store.state |
- more see the test/simple.js
update
Action with action = type standard update: ...
key | type | remark |
---|---|---|
update |
Object |
the update operation, will pass to immutability-helper, equal to immutabilityHelper(store.state, action.update) |
- more see the test/simple.js
- see
update
in immutability-helper homepage
Changelog
License
the MIT License http://magicdawn.mit-license.org