1.0.0-beta.1 • Published 6 years ago

expo-fsstorage v1.0.0-beta.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Expo FS Storage

Expo Persist storage engine for React Native file system

Install

yarn add expo-fsstorage

Usage

import { persistStore } from 'redux-persist'
import { FSStorage } from 'expo-fsstorage';

const persistor = persistStore(store, {
  storage: FSStorage(),
});

The default storage location is a folder called expo-fsstorage in the document directory for your app on the device. You can specify folder for persistor:

import { persistStore } from 'redux-persist'
import { FSStorage, CacheDir } from 'expo-fsstorage';

const cachePersistor = persistStore(store, {
  storage: FSStorage(CacheDir, 'myApp'),
});

This will create myApp folder in cache storage for iOS and Android devices. You may create multiple persistors on different directories.