Gathering detailed insights and metrics for redux-offline-immutable-config
Gathering detailed insights and metrics for redux-offline-immutable-config
Gathering detailed insights and metrics for redux-offline-immutable-config
Gathering detailed insights and metrics for redux-offline-immutable-config
npm install redux-offline-immutable-config
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
3 Commits
1 Forks
3 Watching
2 Branches
2 Contributors
Updated on 06 Jan 2022
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-50%
1
Compared to previous day
Last week
-33.3%
4
Compared to previous week
Last month
87%
43
Compared to previous month
Last year
-68.2%
583
Compared to previous year
Provide a configuration for redux-offline
to use an immutable root state
with redux-persist-immutable
npm install redux-offline-immutable-config
# or
yarn add redux-offline-immutable-config
Follow redux-offline
base setup instruction at redux-offline
, then apply the following changes.
1import { applyMiddleware, createStore, compose } from 'redux'; 2import { offline } from 'redux-offline'; 3import defaultConfig from 'redux-offline/lib/defaults'; 4 5// replacing redux-offline defaults with immutable* counterparts 6import { persist, persistAutoRehydrate, offlineStateLens } from 'redux-offline-immutable-config'; 7 8// ... 9 10// example of redux-persist configuration 11// see https://github.com/rt2zz/redux-persist#persiststorestore-config-callback 12const persistOptions = {}; 13const persistCallback = () => { 14 console.log('rehydration completed') 15}; 16 17const offlineConfig = { 18 ...defaultConfig, 19 persist, 20 persistAutoRehydrate, 21 persistOptions, 22 persistCallback, 23 offlineStateLens 24}; 25 26const preloadedState = fromJS({}); // this is the immutable root state 27const store = createStore( 28 reducer, // your main reducer 29 preloadedState, 30 compose( 31 applyMiddleware(middleware), // your middleware 32 offline(offlineConfig) 33 ) 34);
1import { persist, persistAutoRehydrate, offlineStateLens } from 'redux-offline-immutable-config'; 2 3const autoRehydrateOptions = __DEV__ === true 4 ? {log: true} 5 : {}; 6 7const offlineConfig = { 8 ...defaultConfig, 9 persist, 10 persistAutoRehydrate: () => persistAutoRehydrate(autoRehydrateOptions), 11 persistOptions, 12 persistCallback, 13 offlineStateLens 14}; 15 16// ... 17
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
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
Reason
14 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