rehydrate only works when devtools intrument enabled?
See original GitHub issueI try to save the authentication information inside localStorage. Now, in development everything worked fine, but in production the information is not rehydrated.
In my root module imports I have the following line:
!environment.production ? StoreDevtoolsModule.instrument() : [],
When I change it to instrument in development as well as in production, suddenly also rehydration of the state works.
StoreDevtoolsModule.instrument(),
Do you have an idea what could cause the problem?
For completeness, here is how I activate ngrxLocalStorage (based on the ngrx example project in app/reducers/index.ts
):
export function localStorageSyncReducer(reducer: ActionReducer<any>): ActionReducer<any> {
return localStorageSync({ keys: ['auth'], rehydrate: true })(reducer);
}
export const metaReducers: ActionReducer<any, any>[] = !environment.production
? [localStorageSyncReducer, logger]
: [localStorageSyncReducer];
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Why does JavaScript only work after opening developer tools ...
The console object is only activated when the Dev Toolbar is opened. Prior to that, calling the console object will result in it...
Read more >Chrome DevTools
Chrome DevTools is a set of web developer tools built directly into the Google Chrome browser. ... Get started with Google Chrome's built-in...
Read more >Use DevTools in Internet Explorer mode (IE mode)
In this article. Open DevTools on a tab in IE mode; Remote debugging in IE mode; Replace Internet Explorer automation; See also.
Read more >Angular Ngrx DevTools: Important Practical Tips
This post is a step-by-step guide for setting up your Ngrx Development environment, namely the Ngrx DevTools, but not only: we will also ......
Read more >Chrome DevTools Protocol - GitHub Pages
The Chrome DevTools Protocol allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other Blink-based browsers.
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
I fixed it by moving the meta-reducer into the specific feature module of where i wanted to persist the state
instead of
This issue should be resolved as of
v5.0.0
thanks to @nhaesler’s PR 👍