Skip to content

injectReducer force parameter #9

@GuillaumeCisco

Description

@GuillaumeCisco

Hey there,

I see in the source code:

export function injectReducer(key, reducer, force = false) {
  // If already set, do nothing.
  if (has(store.injectedReducers, key) || force) return;

  set(store.injectedReducers, key, reducer);
  store.replaceReducer(combineReducersRecurse(store.injectedReducers));
}

What is the purpose of the force parameter?
If injectedReducers has the reducer key, it won't replace it
If we force it by settings force to true, it won't replace it either.

Should not the force parameter set to true replace the reducer even if injectedReducers has it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions