agilgur5 / mst-persist

Persist and hydrate MobX-state-tree stores (in < 100 LoC)
Other
87 stars 17 forks source link

Fix Support for Node and Add Docs for Node and SSR #15

Closed agilgur5 closed 5 years ago

agilgur5 commented 5 years ago

Replaces #6 and #9 and resolves #13

The gotchas in #9 were a bit too confusing for me to really be okay with merging such functionality in. On top of that, once I discovered that redux-persist's Storage Engines were also compatible with mst-persist (per #13), it meant that mst-persist could already support Node environments very easily, so I wouldn't want to hamper that type of usage by making it extremely unintuitive. I think asking developers to put a conditional check in their own source code to handle SSR without server-side hydration is much simpler and less confusing, and therefore likely worthwhile even if it entails a bit more thought & work out-of-the-box.