0

It says in the createReducer function of reducers.js that it creates the main reducer with the asynchronously loaded ones:

/**
 * Creates the main reducer with the asynchronously loaded ones
 */
export default function createReducer(asyncReducers) {
  return combineReducers({
    route: routeReducer,
    global: globalReducer,
    language: languageProviderReducer,
    ...asyncReducers,
  });
}

When you generate a route, the reducers are injected there. So which reducers should be in reducers.js? What exactly are async reducers?

dork
  • 4,396
  • 2
  • 28
  • 56

1 Answers1

1
/**
 * Creates the main reducer with the dynamically injected ones
 */
export default function createReducer(injectedReducers) {
  return combineReducers({
    route: routeReducer,
    global: `globalReducer`,
    language: languageProviderReducer,
    ...injectedReducers,
  });

I think. Its an injectedReducer rather than asyncReducer. You can used this to inject reducers dynamically at runtime inside your components index file as shown in the boileplate example.

Prakash Naidu
  • 742
  • 2
  • 7
  • 17