Skip to content

Can currentReducer be exposed? #1246

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

Closed
dashed opened this issue Jan 17, 2016 · 1 comment
Closed

Can currentReducer be exposed? #1246

dashed opened this issue Jan 17, 2016 · 1 comment

Comments

@dashed
Copy link

dashed commented Jan 17, 2016

Can currentReducer be exposed?

https://github.com/rackt/redux/blob/c5d9a8a11897ea558c348e02eaf76038563d57b9/src/createStore.js#L38

I have a usecase where I have some "Higher-Order redux store" that wouldwrap a store's currentReducer via a custom combineReducers and then replace the new reducer through the store's replaceReducer.

@gaearon
Copy link
Contributor

gaearon commented Jan 17, 2016

I'm not sure I understand the problem. Higher order store (aka "store enhancer" in our docs) takes a createStore and returns a createStore. This means it has full access to createStore arguments (including the reducer) and can wrap it before passing to the next function. You can look here for an example (at the very end of the file is a store enhancer that wraps the reducer): https://github.com/gaearon/redux-devtools/blob/master/src/instrument.js

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

2 participants