To better support state serialization and hydration I recommend adding built-in APIs into @ngrx/store. We should try and tackle the two biggest use cases:
Ideally, we would separate the process of persistence and serialization into two steps:
This would allow authors of persistence strategies to focus on persistence without having to reimplement key filtering or Immutable restructuring.
Remember handling async storage in saving to indexedDB or some native cordova plugin filesystem etc.
Just throwing out ideas while we're on the topic ... but it would be awesome if something like https://github.com/btroncone/ngrx-store-localstorage became a first class part of ngrx itself. Serializing out for SSR and indexedDB usage is definitely important too, but I would guess that the majority of people are just saving bits of state to localstorage. Plus, the library above doesn't work with feature modules.
.... When is this going to be implemented? :-( Wasn't it for 7.0?? (today....)
@brandonroberts When do you think it is going to work?
@brandonroberts may I take this?
@Dutchboy @itayod we're going to put together a design for this first, which we have on our list to look at since version 8 has launched.
@brandonroberts sounds great!
meanwhile, I have posted a blog that might help users to implement it:
https://medium.com/better-programming/sync-your-state-in-local-storage-with-ngrx-9d6ceba93fc0
I'm using ngrx-store-sync that I hacked together. Seems to work for my use case.
Putting it here to maybe give you some ideas how to do it (or not do it :D)
@itayod maybe update your article and repo to 8, because of breaking changes in meta reducer
@rickvandermey Thanks for noticing me! but I think most of the users are still on version 7.X. so I guess update it now could lead to some confusion at this point :)
Any news on this one?
Is there any more news? What have you done to contribute.
@classifieds-dev relax man! I was just asking!
Most helpful comment
Just throwing out ideas while we're on the topic ... but it would be awesome if something like https://github.com/btroncone/ngrx-store-localstorage became a first class part of ngrx itself. Serializing out for SSR and indexedDB usage is definitely important too, but I would guess that the majority of people are just saving bits of state to localstorage. Plus, the library above doesn't work with feature modules.