Gathering detailed insights and metrics for redux-persist-filesystem-storage
Gathering detailed insights and metrics for redux-persist-filesystem-storage
Gathering detailed insights and metrics for redux-persist-filesystem-storage
Gathering detailed insights and metrics for redux-persist-filesystem-storage
npm install redux-persist-filesystem-storage
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
196 Stars
78 Commits
71 Forks
3 Watching
2 Branches
15 Contributors
Updated on 21 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-14.8%
2,158
Compared to previous day
Last week
29%
12,086
Compared to previous week
Last month
3.1%
42,673
Compared to previous month
Last year
1.3%
442,518
Compared to previous year
1
1
Storage adaptor to use react-native-blob-util with redux-persist, by implementing the needed methods: setItem
, getItem
, removeItem
, getAllKeys
and clear
.
This storage can be used on Android to prevent issues with the storage limitations in the RN AsyncStorage implementation. (See redux-persist#199, redux-persist#284)
Please note: v2 of this library supports React Native 0.60 and above only. If you are using React Native 0.59 and below, please use v1.x.
1yarn add redux-persist-filesystem-storage
or, for React Native 0.59 and below:
1yarn add redux-persist-filesystem-storage@1
Then, as react-native-blob-util is a dependency of this project, it will also need setting up as its their installation docs.
Simply use 'FilesystemStorage' as the storage option in the redux-persist config.
1import FilesystemStorage from 'redux-persist-filesystem-storage' 2... 3 4const persistConfig = { 5 key: 'root', 6 storage: FilesystemStorage, 7} 8 9...
1import FilesystemStorage from 'redux-persist-filesystem-storage' 2... 3 4// These are all the config options, with their default values 5FilesystemStorage.config({ 6 storagePath: `${RNFetchBlob.fs.dirs.DocumentDir}/persistStore`, 7 encoding: "utf8", 8 toFileName: (name: string) => name.split(":").join("-"), 9 fromFileName: (name: string) => name.split("-").join(":"), 10}); 11 12const persistConfig = { 13 key: 'root', 14 storage: FilesystemStorage, 15 toFileName: (name: string) => name.split(":").join("-"), 16 fromFileName: (name: string) => name.split("-").join(":") 17} 18 19...
Using redux-persist V5?
Redux-Persist v5 migrate from one storage system to another
Using redux-persist V4?
the snippet below lets you migrate redux data previously stored in
AsyncStorage
to redux-persist-filesystem-storage
.
NOTE This snippet lets you migrate healthy data. It will not restore
data if it is already hit limits of AsyncStorage
1import { persistStore, getStoredState } from 'redux-persist' 2import FilesystemStorage from 'redux-persist-filesystem-storage' 3import { AsyncStorage } from 'react-native' 4import _ from 'lodash' 5import { createStore } from 'redux' 6 7const store = createStore(...) 8 9// create persistor for `redux-persist-filesystem-storage` 10const fsPersistor = persistStore( 11 store, 12 { storage: FilesystemStorage }, 13 async (fsError, fsResult) => { 14 if (_.isEmpty(fsResult)) { 15 // if state from fs storage is empty try to read state from previous storage 16 try { 17 const asyncState = await getStoredState({ storage: AsyncStorage }) 18 if (!_.isEmpty(asyncState)) { 19 // if data exists in `AsyncStorage` - rehydrate fs persistor with it 20 fsPersistor.rehydrate(asyncState, { serial: false }) 21 } 22 } catch (getStateError) { 23 console.warn("getStoredState error", getStateError) 24 } 25 } 26 } 27)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 6/17 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More