Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[How to add NgRx] - NgRx Store & App State handling#259

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hakonamatata wants to merge9 commits intoTrilonIO:master
base:master
Choose a base branch
Loading
fromhakonamatata:ngrx_store
Open

[How to add NgRx] - NgRx Store & App State handling#259

hakonamatata wants to merge9 commits intoTrilonIO:masterfromhakonamatata:ngrx_store

Conversation

@hakonamatata
Copy link
Contributor

Added ngrx/store

  • Changed the counter component to use ngrx store instead
  • Router state saved as global state
  • Tested with AOT and server rendering, it works!
  • Updated readme to include an image of redux dev tools in action

Take and remove what you like@MarkPieszak 😉

MarkPieszak, pjmagee, and EricBichara reacted with thumbs up emojiMarkPieszak and LiverpoolOwen reacted with hooray emojiMarkPieszak reacted with heart emoji
@pjmagee
Copy link

Where would you rehydrate the store?

@estebanvega
Copy link

@pjmagee Could you usehttps://github.com/btroncone/ngrx-store-localstorage to rehydrate from localStorage. Should work with angular 4.x as well.

@estebanvega
Copy link

@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 likehttps://github.com/ngrx/effects?

@pjmagee
Copy link

pjmagee commentedJul 10, 2017
edited
Loading

@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 youreally 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.

@MarkPieszak
Copy link
Member

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. 👍

pjmagee and NgxDev reacted with thumbs up emoji

@MarkPieszakMarkPieszak changed the titleNgRx/store state handling[How to add NgRx] - NgRx Store & App State handlingAug 19, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@hakonamatata@pjmagee@estebanvega@MarkPieszak

[8]ページ先頭

©2009-2025 Movatter.jp