All Projects → leethree → redux-persist-fs-storage

leethree / redux-persist-fs-storage

Licence: MIT license
Redux Persist storage engine for React Native file system

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to redux-persist-fs-storage

OneArtical
learning and practice redux,react-redux,redux-saga,redux-persist,redux-thunk and so on
Stars: ✭ 61 (+52.5%)
Mutual labels:  redux-persist
React Antd Todo
A simple todo list app built with React, Redux and Antd - Ant Design
Stars: ✭ 42 (+5%)
Mutual labels:  redux-persist
Slopeninja Native
 Slope Ninja App 🎿❄️⛄️
Stars: ✭ 160 (+300%)
Mutual labels:  redux-persist
React Native Boilerplate
🚀 Type Based Architecture for developing React Native Apps using react, redux, sagas and hooks with auth flow
Stars: ✭ 375 (+837.5%)
Mutual labels:  redux-persist
React Native Workshop
Prototyping Airbnb with React Native
Stars: ✭ 21 (-47.5%)
Mutual labels:  redux-persist
Reactnativelaravellogin
Sample App for login using laravel 5.5 React Native and Redux
Stars: ✭ 75 (+87.5%)
Mutual labels:  redux-persist
youtube-redux-persist
To do App developed in the Redux Persist video
Stars: ✭ 15 (-62.5%)
Mutual labels:  redux-persist
react-native-ultimate-starter
A React Native Ultimate Starter - react-navigation v5 + redux-toolkits + dark and light theme and more.
Stars: ✭ 16 (-60%)
Mutual labels:  redux-persist
Slopeninja Frontend
Slope Ninja Frontend 🏂❄️⛄️
Stars: ✭ 39 (-2.5%)
Mutual labels:  redux-persist
Redux React Navigation Demos
React-Native + Redux + Redux-Persist + React Navigation ( Authentication Flow with Redux demos)
Stars: ✭ 151 (+277.5%)
Mutual labels:  redux-persist
Pwa Theme Woocommerce
E-commerce Progressive Web App Theme (React & Redux)
Stars: ✭ 382 (+855%)
Mutual labels:  redux-persist
React Native Boilerplate
🚀 React Native Boilerplate Updated
Stars: ✭ 9 (-77.5%)
Mutual labels:  redux-persist
Cnoder
Yet another CNode Flutter App
Stars: ✭ 84 (+110%)
Mutual labels:  redux-persist
Redux Persist Transform Encrypt
Encrypt your Redux store
Stars: ✭ 306 (+665%)
Mutual labels:  redux-persist
Flutter Things Todo
An example Todo App using Flutter with advanced features
Stars: ✭ 189 (+372.5%)
Mutual labels:  redux-persist
Fakeflix
Not the usual clone that you can find on the web.
Stars: ✭ 4,429 (+10972.5%)
Mutual labels:  redux-persist
Redux Persist Expo Securestore
redux-persist storage for Expo's SecureStore
Stars: ✭ 61 (+52.5%)
Mutual labels:  redux-persist
crossbones
Fullstackian award, 1707-FSA-NY. a cross-platform barebones react native setup inspired by https://github.com/FullstackAcademy/bones by
Stars: ✭ 19 (-52.5%)
Mutual labels:  redux-persist
Redux Persist Sensitive Storage
redux-persist storage engine for react-native-sensitive-info
Stars: ✭ 209 (+422.5%)
Mutual labels:  redux-persist
React Native Feature Boilerplate
Feature based Architecture for developing Scalable React Native Apps 🚀 using react, redux, sagas and hooks
Stars: ✭ 139 (+247.5%)
Mutual labels:  redux-persist

Redux Persist FS Storage

Redux Persist storage engine for React Native file system

Inspired by redux-persist-filesystem-storage, this module works as adapter between react-native-fs and redux-persist.

Install

yarn add react-native-fs redux-persist-fs-storage

This will install react-native-fs as dependency. So make sure to link it natively:

react-native link react-native-fs

See react-native-fs's documentation for details.

Usage

Both Redux Persist v4 and v5 are supported.

Redux Persist v5:

import { persistStore, persistReducer } from 'redux-persist';
import FSStorage from 'redux-persist-fs-storage';

const persistConfig = {
  key: 'root',
  keyPrefix: '', // the redux-persist default is `persist:` which doesn't work with some file systems
  storage: FSStorage(),
};

const persistedReducer = persistReducer(persistConfig, reducer);

const store = createStore(persistedReducer);
const persistor = persistStore(store);

Redux Persist v4:

import { persistStore } from 'redux-persist';
import FSStorage from 'redux-persist-fs-storage';

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

The default storage location is a folder called reduxPersist 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 'redux-persist-fs-storage';

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].