-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
replaceReducer with shouldHotReload: false erases action history #378
Comments
Running into the same issue - all state transitions prior to |
See more details in this issue: #559. |
@Methuselah96 would you accept a PR to fix this? This is causing issues with the |
My half-informed suspicion is that there might not be a feasible resolution, because the DevTools relies on replaying actions to show the state at that point in time. If a reducer gets swapped out now, running the "old" actions through it would presumably result in states that don't match what the state was when the original dispatches happened. Happy to be proven wrong here, but that's my first thought. |
One option to improve it would be to store old reducers as well as the current one, so that when replaying actions, it uses the reducer that was current at that time. Another would be to show the action history but disable replayability before the last call to replaceReducers. I think both of those would be an improvement over the current behavior. Thoughts? |
Hmm. That could hypothetically work, although there'd have to be bookkeeping to know which actions were dispatched when a given reducer was in use. |
I know this thread is somewhat dead, but I wonder if there's a way to differentiate between the |
Still running into this issue, which is really annoying, is there any progress with it ? |
I am trying to implement code splitting in my app, and I call replaceReducer when a new reducer is loaded. I use the shouldHotReload: false option to avoid rerunning actions, but now the actions dispatched before replaceReducer are erased from the action history when viewing the devtools. I just see @@init and then ASYNC_LOAD_COMPLETE, which is dispatched after replaceReducer runs successfully.
Is it possible to preserve the state transitions and actions from before replaceReducer?
Note: I am using the redux devtools chrome extension, so it may just be an issue in that project. But since it uses this library, I just assumed this behavior came from here and not there. If that's wrong I can refile with them.
The text was updated successfully, but these errors were encountered: