Migrate to mmkv or similar from async storage #814
gmaclennan
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently we use async storage for persisting data in Mapeo. The main data we persist are:
Async storage is async (it's in the name!) and it needs to be because it is quite slow. However this adds a lot of complexity to our app, because everywhere that we persist data we need to handle a loading state (we generally do this by not rendering the app until everything has loaded).
An alternative option is
react-native-mmkv
which is fast and synchronous. Realm would also work, and we may well use it for a future implementation of Mapeo Core, but it might be a bit of a sledgehammer solution for storing user settings (although the support for migration might be really helpful).This change would allow us to remove a lot of code that uses
usePersistedState.js
to remove the need for handling a 'status' (e.g.loading
) for the persisted state.Beta Was this translation helpful? Give feedback.
All reactions