redux-magic-reducer
This library aims at solving the problem dynamic reducer problem (please read: https://stackoverflow.com/questions/32968016/how-to-dynamically-load-reducers-for-code-splitting-in-a-redux-application). This implementation is based on answer provided by @gaearon .
Why?
To make redux applications simpler by allowing dynamic state creation, specifically in cases where code splitting is done.
Install
npm install --save redux-magic-reducer
How to use
1. Create a Store
import createStore from 'redux-magic-reducer'; const globalReducer = { return appName: 'redux-magic-reducer' ; } ; let store = ;
2. Attach a dynamic Reducer
const dynamicReducer = state = subReducerKey: "subReducerValue" action switchactiontype default: return state; ; store;
License
MIT © saurabhnemade