Gathering detailed insights and metrics for redux-persist-transform-filter
Gathering detailed insights and metrics for redux-persist-transform-filter
Gathering detailed insights and metrics for redux-persist-transform-filter
Gathering detailed insights and metrics for redux-persist-transform-filter
npm install redux-persist-transform-filter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
190 Stars
54 Commits
21 Forks
6 Watching
4 Branches
9 Contributors
Updated on 02 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-17.2%
4,017
Compared to previous day
Last week
-4.8%
24,584
Compared to previous week
Last month
-25%
113,289
Compared to previous month
Last year
18.5%
2,009,347
Compared to previous year
1
2
Filter transformator for redux-persist
npm install redux-persist-transform-filter
1import { createFilter, createBlacklistFilter } from 'redux-persist-transform-filter'; 2 3// this works too: 4import createFilter, { createBlacklistFilter } from 'redux-persist-transform-filter'; 5 6// you want to store only a subset of your state of reducer one 7const saveSubsetFilter = createFilter( 8 'myReducerOne', 9 ['keyYouWantToSave1', 'keyYouWantToSave2'] 10); 11 12// you want to remove some keys before you save 13const saveSubsetBlacklistFilter = createBlacklistFilter( 14 'myReducerTwo', 15 ['keyYouDontWantToSave1', 'keyYouDontWantToSave2'] 16); 17 18// you want to load only a subset of your state of reducer three 19const loadSubsetFilter = createFilter( 20 'myReducerThree', 21 null, 22 ['keyYouWantToLoad1', 'keyYouWantToLoad2'] 23); 24 25// saving a subset and loading a different subset is possible 26// but doesn't make much sense because you'd load an empty state 27const saveAndloadSubsetFilter = createFilter( 28 'myReducerFour', 29 ['one', 'two'] 30 ['three', 'four'] 31); 32 33const predicateFilter = persistFilter( 34 'form', 35 [ 36 { path: 'one', filterFunction: (item: any): boolean => item.mustBeStored }, 37 { path: 'two', filterFunction: (item: any): boolean => item.mustBeStored }, 38 ], 39 'whitelist' 40) 41 42const normalPathFilter = persistFilter( 43 'form', 44 ['one', 'two'], 45 'whitelist' 46) 47 48persistStore(store, { 49 transforms: [ 50 saveSubsetFilter, 51 saveSubsetBlacklistFilter, 52 loadSubsetFilter, 53 saveAndloadSubsetFilter, 54 ] 55});
1git clone https://github.com/edy/redux-persist-transform-filter-example.git 2cd redux-persist-transform-filter-example 3npm install 4npm start
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/28 approved changesets -- score normalized to 2
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
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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