npm.io
1.0.6 • Published 11 months ago

expo-filesystem-storage

Licence
ISC
Version
1.0.6
Deps
0
Size
5 kB
Vulns
0
Weekly
0

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);

...

Keywords