Dynamic redux
With dynamic redux you can inject your reducers on the fly
Installation
nikandlv@nikandlv.ir:~$ npm install redux react-redux redux-thunk
Then simply copy Data
folder into your project
Setup
Import it
Wrap your root component or any base component
ReactDOM;
Injecting a reducer
Import the store and a reducer
Inject your reducer
Store
injectReducer
takes two parameters a key
and the reducer
withDynamic
builder
Use using withDynamic
builder you can easily access your reducers
and actions
in your components
; MyComponent
there are 2 main functions
injectAction
which takes function name and the action and injects it into your component props
injectReducer
which takes a reducer name and injcets it into your component props