[Enhancement]: rehydrate store when open app
can you add rehydrate store from device storage when open the app? Thank you!
You can easily do that yourself, can't you?
Maybe :D
On Sun, Aug 26, 2018 at 12:20 AM, Günter Zöchbauer <[email protected]
wrote:
You can easily do that yourself, can't you?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidmarne/built_redux/issues/93#issuecomment-415984091, or mute the thread https://github.com/notifications/unsubscribe-auth/AcLAYYU0PVTSrc3wGaMyQXAkBuxocKKxks5uUYdYgaJpZM4WMWUx .
Yea i think this is easy enough to do by yourself. All you have to do is read the state object from storage before constructing your store and pass that to the store as the store's defaultState parameter.
Did you have a specific idea on a way built_redux could make this easier?
I think redux_persist isn't that so simple how it looks like. Would be much better to have package like that for built_redux
I created a example for persisting store with built_redux. Code is based on redux_persist. I didn't want to open source it as package because lack of tests and I think quality is much worse than redux_persist. Maybe in next week I'll have more time to make it right. I'll post it in case that someone need it.
built_redux_persist - persistor + middleware: https://gist.github.com/kdela/5770169aaee1ea1019eb8101266ab5ba
built_redux_persist_flutter - flutter storage (with shared preferences) https://gist.github.com/kdela/21e301344a0699bdd22973b0bb8b260f
store example: https://gist.github.com/kdela/6b8b8c074694cab5858bc137088eda86