replaceReducer eliminates enhancer
See original GitHub issueWhat is the current behavior?
If you use an enhancer when creating your Redux store, the first subsequent call to replaceReducer
on the store seems to remove the enhancer.
Steps to Reproduce
Run this JSFiddle and observe the console
The enhancer will stop logging actions following the call to replaceReducer
What is the expected behavior?
Not sure if what I’m reporting is not a bug and I’m misunderstanding the usage of enhancers; But seems to me enhancers should persist for the lifetime of the store, regardless of which reducers are being used.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (13 by maintainers)
Top Results From Across the Web
Usage Guide - Redux Toolkit
The basic Redux createStore function takes positional arguments: (rootReducer, preloadedState, enhancer) . Sometimes it's easy to forget ...
Read more >How Redux Works - Part 1 - Matthew Gerstman
This takes three arguments reducer preloadedState and enhancer . Reducer. The first one is hopefully straightforward. This is the rootReducer ...
Read more >Reading Redux: createStore - Universe Engineering
The createStore function accepts a reducer , preloadedState , and an enhancer . We call the value returned by the createStore function a...
Read more >Redux in 27 lines - DEV Community
The unsubscribe function removes the subscriber from the internal ... Redux only ships with a single enhancer, namely applyMiddleware ...
Read more >Usage Guide - Redux Toolkit - Netlify
Importing or creating the root reducer function · The basic Redux createStore function takes positional arguments: (rootReducer, preloadedState, enhancer) .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Opened up #4129 to cover that topic.
Yeah, I’d like to see 5.0 released too, but it needs some meaningful attention to figure out what other types changes might be necessary, and given everything else going on it’s just at the bottom of the priority list for us right now.
If someone else with serious TS knowledge wants to help us out and try to push the current TS port forward by evaluating it and seeing where things stand and how it can be improved, I’d love it.