redux-rack
v1.0.1-0
Published
Treat Redux like a rack — mount reducers like components
Downloads
6
Readme
redux-rack
Treat Redux like a rack — mount reducers like components
Use
withReducer('foo', (foo, action) => foo)(Component)
Combine
withReducer({
foo(foo, action) {
// … reducer logic …
},
bar(bar, action) {
// … reducer logic …
},
})
Nest
withReducer({
bar(bar, action) {
// … reducer logic …
},
// Runs after, on nested value
'bar.baz': (baz, action) => {
// … reducer logic …
},
})
Iterate
withReducer({
// Run for each list item
'foos[]': (item, action) => {
// … reducer logic …
},
// Run after, for each item property
'foos[].ball': (property, action) => {
// … reducer logic …
},
})
Throw caution to the wind
withReducer((state, action) =>
// time for something completely different
)
Status
withReducer signature
- [x] simple
(key, reducer)
- [ ] combined
{ foo, bar }
- [ ] nested
{ bar, bar.baz }
- [ ] iterative
{ foos[], foos[].prop }
- [x] global,
window.throw(caution)
- [x] simple
Development
- [ ] stable
- [x] active
- [ ] wanting
- [ ] in need of intervention