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

Manage all persistence in the application provider #30

Open
jackdclark opened this issue Aug 6, 2020 · 0 comments
Open

Manage all persistence in the application provider #30

jackdclark opened this issue Aug 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jackdclark
Copy link

jackdclark commented Aug 6, 2020

The way we read from & write to AsyncStorage/SecureStore in some components makes the state flow quite hard to follow. I think it would be nice if all of it was managed by the application provider, like we do for some things already in the setContext function. Then we can treat the application context as the source of truth for these values in our components & just ensure they’re synced with storage in the provider.

We do this already for some values (see https://github.com/covidgreen/covid-green-app/blob/current/providers/context.tsx#L225-L239). Can we improve this and make it easier to identify what's persisted? Something along the lines of the way you tell redux-persist that a certain branch of your application state should be persisted.

@jackdclark jackdclark added the enhancement New feature or request label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant