Like Redux's combineReducers
, but more better!
Everyone loves a little hierarchy! Place your reducers at any depth in the store:
const reducer = combinedReduction({
session: session.reducer,
entities: {
users: users.reducer,
},
});
Now, you could use compose
to chain together multiple top level reducers, but what's the fun in that?
How about declaring all your reducers in one handy place:
const reducer = combinedReduction(
migrations.reducer,
{
session: session.reducer,
entities: {
users: users.reducer,
},
},
);
Top level reducers are passed directly as arguments, and are processed in order.