Gathering detailed insights and metrics for @piotr-cz/redux-persist-idb-storage
Gathering detailed insights and metrics for @piotr-cz/redux-persist-idb-storage
Gathering detailed insights and metrics for @piotr-cz/redux-persist-idb-storage
Gathering detailed insights and metrics for @piotr-cz/redux-persist-idb-storage
npm install @piotr-cz/redux-persist-idb-storage
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
26 Stars
69 Commits
4 Forks
2 Watching
2 Branches
2 Contributors
Updated on 09 Oct 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
16.1%
361
Compared to previous day
Last week
2.3%
1,578
Compared to previous week
Last month
20.1%
7,146
Compared to previous month
Last year
27.2%
55,212
Compared to previous year
Storage adapter to use IndexedDB via idb v3 with redux-persist ripped from idb v3 docs > Examples section
Using npm:
1npm install --save @piotr-cz/redux-persist-idb-storage
or Yarn:
1yarn add @piotr-cz/redux-persist-idb-storage
Import the storage and include it in persistConfig
when creating Redux store:
1// configureStore.js 2 3import createIdbStorage from '@piotr-cz/redux-persist-idb-storage' 4 5const persistConfig = { 6 key: 'root', 7 storage: createIdbStorage({name: 'myApp', storeName: 'keyval'}), 8 serialize: false, // Data serialization is not required and disabling it allows you to inspect storage value in DevTools; Available since redux-persist@5.4.0 9 deserialize: false, // Required to bear same value as `serialize` since redux-persist@6.0 10} 11 12// ...
When using Server-Side Rendering (SSR), indexedDB won't be available in the environment.
In this case you may use feature detection with a fallback to use default redux-persist storage (which resolves to noop functions):
1// configureStore.js 2 3// Redux Persist storage 4import defaultStorage from 'redux-persist/lib/storage' 5 6// IndexedDB storage 7import createIdbStorage from '@piotr-cz/redux-persist-idb-storage/src' 8 9const persistConfig = { 10 key: 'root', 11 storage: globalThis.indexedDB ? createIdbStorage({name: 'myApp', storeName: 'keyval'}) : defaultStorage, 12 serialize: false, 13}
See idb API
name
(optional): IndexedDB Database name. Defaults to 'keyval-store'
.storeName
(optional): IndexedDB Store name. Defaults to 'keyval'
.version
(optional): Schema version. Defaults to 1
.upgradeCallback
(optional): Defaults to upgradeDb => upgradeDb.createObjectStore(options.storeName)
.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/12 approved changesets -- 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