You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
Right now, the way I have to compose reducers require to provide all reducers at once and then store is created. Is it possible that once I load a component, I load the reducer, saga for that particular component? Something like this where I inject a couple of reducers and then load others as they come:
import { combineReducers } from 'redux-immutable';
import appReducer from './containers/app-root/app.reducer';
import homeReducer from './containers/home/home.reducer';
/**
* Creates the main reducer with the asynchronously loaded ones
*/
export default function createReducer(asyncReducers?) {
return combineReducers({
app: appReducer,
home: homeReducer,
...asyncReducers,
});
}
This createReducer can then be used while creating my store like this:
const store = createStore(
createReducer(),
immutable.fromJS(initialState),
composeEnhancers(...enhancers)
);
Typically, while routing using ion-router I would like to specify the reducer and saga (or thunk) for a route.