1.0.1-0 • Published 9 years ago
redux-rack v1.0.1-0
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
- simple
(key, reducer) - combined
{ foo, bar } - nested
{ bar, bar.baz } - iterative
{ foos[], foos[].prop } - global,
window.throw(caution)
- simple
Development
- stable
- active
- wanting
- in need of intervention