btroncone / ngrx-examples

@ngrx examples and resources
371 stars 68 forks source link

Autosave feature in ngrx store #22

Open moniuch opened 7 years ago

moniuch commented 7 years ago

I would love to see an example of an auto-save feature implementation in ngrx store that would satisfy the following scenario:

(Let's say we have an app that allows users to store/retrieve their own html code.)

The path I think I would take would be to store the html as well as the loaded flag in the state, and when page1 loads, load the html only if "loaded" flag is false. But I don't know where to place this "if" test.

Anyway, a complete example (Angular2, TS) would be nice.