Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

injectReducer force parameter #9

Open
GuillaumeCisco opened this issue Aug 24, 2017 · 1 comment
Open

injectReducer force parameter #9

GuillaumeCisco opened this issue Aug 24, 2017 · 1 comment

Comments

@GuillaumeCisco
Copy link

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?

@GuillaumeCisco
Copy link
Author

I've just created a PR for fixing this issue: #10
It would be great if it could be merged quickly and released on npm.

It allows us to support hot reloading with reducer.
I've also made the same change with redux-sagas-injector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant