-
Notifications
You must be signed in to change notification settings - Fork 433
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
[How to add NgRx] - NgRx Store & App State handling #259
base: master
Are you sure you want to change the base?
Conversation
Where would you rehydrate the store? |
@pjmagee Could you use https://github.com/btroncone/ngrx-store-localstorage to rehydrate from localStorage. Should work with angular 4.x as well. |
@hakonamatata @MarkPieszak would it be interesting to see an example of an XHR request to an REST API, which in turn updates the client store via something like https://github.com/ngrx/effects? |
@estebanvega @MarkPieszak but what about SSR since ngrx-store-localstorage has browser dependencies? Also what about authentication? When a user is authenticated and the site is refreshed, then authentication is lost from the store...and....do you really want to store that information in local storage? :) Actually,, SSR seems so pointless right now, many third party components will just break if you have SSR enabled. Things like PrimeNG etc. |
A lot of those decisions (on what to pass down from server->client) and such you'd need to decide for your project what's important to do that with, and what you can live without rendering on the server (and let it just happen on the client). PrimeNG unfortunately entangled their library into the DOM instead of using Renderer and other abstractions provided :/ On the bright side though! We are working on adding a mocking layer over the window/document/etc so that it will be more flexible and hopefully better accommodate libraries that are accidentally (or not) using the DOM, so that they will still be able to Render in a server-render. 👍 |
Added ngrx/store
Take and remove what you like @MarkPieszak 😉