- Natively Supported Providers
- Redux Persist Providers
AsyncStorageCaveat- Using other storage providers
apollo3-cache-persist provides wrappers for the following storage providers, with no additional dependencies:
| Storage provider | Platform | Wrapper class |
|---|---|---|
AsyncStorage* |
React Native | AsyncStorageWrapper |
window.localStorage |
web | LocalStorageWrapper |
window.sessionStorage |
web | SessionStorageWrapper |
localForage |
web | LocalForageWrapper |
Ionic storage |
web and mobile | IonicStorageWrapper |
MMKV Storage |
React Native | MMKVStorageWrapper |
MMKV |
React Native | MMKVWrapper |
apollo3-cache-persist uses the same storage provider API as
redux-persist, so you can also make
use of the providers
listed here,
including:
*AsyncStorage
does not support
individual values in excess of 2 MB on Android. If you set maxSize to more than 2 MB or to false,
use a different storage provider, such as
react-native-mmkv-storage or
redux-persist-fs-storage.
apollo3-cache-persist supports stable versions of storage providers mentioned above.
If you want to use other storage provider, or there's a breaking change in next version of supported provider,
you can create your own wrapper. For an example of a simple wrapper have a look at AsyncStorageWrapper.
If you found that stable version of supported provider is no-longer compatible, please submit an issue or a Pull Request.