question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

replaceReducer eliminates enhancer

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
markeriksoncommented, Jul 6, 2021

Opened up #4129 to cover that topic.

1reaction
markeriksoncommented, Jul 6, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found