-
Notifications
You must be signed in to change notification settings - Fork 866
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
It doesn't work when Nested Persists combine with Hot Module Replacement #940
Comments
I'm not sure either. @rt2zz might be able to help when he has time. |
Can confirm that we are seeing this as well. I was looking for information about why only the first persistoid was working, and came across this. The last change that went in along with multiple nested reducers was us fixing hot module replacement... |
Can confirm this. I am seeing this exact behavior using 5.10.0 |
Can confirm this same issue, albeit in a slightly different use-case: we use aggressive code splitting and dynamically attach & detach reducers as the user navigates to different views in our application. Some views have view-specific reducer state that needs to be persisted, so we use a nested setup similar to @nishino-tsukasa's example. Even though if (_persist) return state As a result, the nested reducers remain in the paused state indefinitely and no state for them is persisted. |
Hi, @rt2zz
It doesn't work when Nested Persists combine with Hot Module Replacement.
I implement Nested Persists in my project. It works very well。
Recently, I need to use HMR, but I found only work first persist in Nested Persists.
Example
I call persist() after calling store.replaceReducer. Other state be persisted after updated, but A state not be persisted after updated.
I found out by reading the source code that in the 108th line in the persistReducer.js file.
The action is not propagated down, causing _paused in other persisters to be equal to true and not becoming false. I forked your project and changed the 108 line of code to
, and it worked. I am not sure if this change will cause other bugs. I want to know if there is a problem with the usage or a bug in the project itself.
The text was updated successfully, but these errors were encountered: