TrilonIO/aspnetcore-angular-universal

Pass NgRx State from Server -> Client

MarkPieszak opened this issue ยท 4 comments

Currently we have NgRx Store on the Server, but we need to pass these easily to the client, then initialize the Store with those values. This way if someone uses the Store to handle a lot of their application they can transfer cache/state here instead.

This is another option as opposed to HttpCacheService.

(Could be connected with ngrx/store#294)

@MarkPieszak Is this still a problem for being able to add ngrx store rehydration/hmr ngrx store rehydration to the template?

I have an example of how it can be used with HttpTransfer and everything let me find it.

I've currently gone through migrating our application from the old Angular2 template to this current template on Master, however we are now using ngrx and ngrx effects for our api, user state, however I'm still pretty new to the angular/js world and I've been struggling to figure out how to rehydrate...a little mockup would be awesome ๐Ÿ‘

@pjmagee
You can see it here in this PR, it'd be along these lines.
https://github.com/MarkPieszak/aspnetcore-angular2-universal/pull/259/files

Hope that helps!