expo-filesystem-storage
v1.0.5
Published
Storage engine which uses Expo FileSystem API. Can be used as a replacement of AsyncStorage in redux-persist
Downloads
189
Maintainers
Readme
expo-filesystem-storage
Storage engine for Expo FileSystem API. Alternative of default AsyncStorage to get over storage size limitations in Android.
Install
npm install expo-filesystem-storage
Usage with redux-persist
import createExpoFileSystemStorage from 'expo-filesystem-storage'
...
const expoFsStorage = createExpoFileSystemStorage();
const persistConfig = {
key: 'root',
storage: expoFsStorage,
};
const persistedReducer = persistReducer(persistConfig, reducer);
const store = createStore(persistedReducer);
const persistor = persistStore(store);
...
Customized options
...
const customOptions = {
storagePath: `${FileSystem.documentDirectory}persistStore`,
debug: true,
}
const expoFsStorage = createExpoFileSystemStorage(customOptions);
...