Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: rehydrate store when open app #93

Open
datvtwkm opened this issue Aug 25, 2018 · 5 comments
Open

[Enhancement]: rehydrate store when open app #93

datvtwkm opened this issue Aug 25, 2018 · 5 comments

Comments

@datvtwkm
Copy link

can you add rehydrate store from device storage when open the app? Thank you!

@zoechi
Copy link
Contributor

zoechi commented Aug 25, 2018

You can easily do that yourself, can't you?

@datvtwkm
Copy link
Author

datvtwkm commented Aug 26, 2018 via email

@davidmarne
Copy link
Contributor

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?

@kdela
Copy link

kdela commented Feb 26, 2019

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

@kdela
Copy link

kdela commented Mar 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants