Redux extended reducers
Rationale
A function exCombineReducers()
handles depedency injection into reducers in tree.
Usage
exCombineReducers()
accepts reducer tree:
const reducerTree = foo: bar: baz: fox: ;const rootReducer = ;
makePlainReducer()
: returns reducer which handles initial statemakeExReducer
: returns reducer which handles initial state and has dependency specification storedexCombineReducer()
: returns a root reducer, which will traverse reducers tree and handle depedency injection.
Key features:
- all depedencies are resolved in one cycle for one action
- dependency paths formats:
@some.path
: absolute path from any place in tree to root state^sibling.path
: path to sibling branch^^parentSibling.path
: path to parent's sibling branch
- dependent ex reducers and plain reducers can be mixed in any order
Limitations:
- no cycle depedencies
- no dependencies to 'ancestors'
Development
- update version:
npm version
- publish:
npm publish