polemius / recoil-persist

Package for recoil state manager to persist and rehydrate store
https://polemius.dev/recoil-persist/
MIT License
353 stars 39 forks source link

Seeding starting data #30

Open dpalay opened 3 years ago

dpalay commented 3 years ago

I'd like my app to start with some more complex defaults than what recoil could give by itself. I was hoping that there'd be a way to seed the state into local storage and then have recoil pick that up, but I'm having difficulty with it. I'm using an atomFamily + atom<id[]> pair, and want to start the app with 2 of the objects. Is there a good way to do this with recoil-persist?

polemius commented 3 years ago

The default in atom configuration doesn't work? Could you please add some code?