-
-
Notifications
You must be signed in to change notification settings - Fork 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
Can't import lazy-loaded module's state from json using Redux DevTools #1326
Comments
Duplicate of #919 (which was closed, but is not really solved yet, @brandonroberts maybe you should reopen it). |
Why do you consider it not resolved? Because its not released? |
#919 contains one specific use case which is not resolved yet, which explains the same problem of the issue which is reported here I think:
Part of #919 was fixed through the "wait for update reducers initially", but this specific use case was not. |
I am planning to introduce state management layer in my official angular project , I want to show a demo to team that how we can replay actions by importing jsons , but facing the same above mentioned issue. If this got resolved , then I can conduct the magic show to the team. I am planning to add deffered actions queue in root metareducer and execute those actions again on lazy module load. But , is there anyway to check those actions are already added to store or not. Do we have any action collection to check incoming action present or not? |
There is a "update reducers" action I think, which is called everytime a new reducer is added. If you load the app with devtools open you should see these actions. But this would be only a workaround on your side. To really fix this, we need to finish what was started in #955 . |
I can able to retain state now with lazy loading reducers but not using update reducers. I have maintained a deferred action collection , on module load ngOnit executing the action collection in side effect. For time being , this is ok for me. One drawback is for each action call , there will be two calls - failed action call and success action call while replaying. |
I'm developing an application using Angular and ngrx with redux DevTools for Chrome. My application has also a lazy-loaded module and I configured it like this:
and this is my reducer index file:
With this configuration everything works well but I noticed that when I export the state of the application (as a json) using the ReduxDevTools and than I upload it, the state of the lazy module is not loaded. It remains null.
If I start the application right in the state of the lazy-laoded module and then I import the json, it works, but if I start from the beginning of the app, then I import the json, using the time-slider, when I reach the lazy module the state is null (default).
Expected behavior:
The state of lazy-loaded modules should be imported correctly from json.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
The text was updated successfully, but these errors were encountered: