Gathering detailed insights and metrics for sync-query-redux
Gathering detailed insights and metrics for sync-query-redux
Gathering detailed insights and metrics for sync-query-redux
Gathering detailed insights and metrics for sync-query-redux
npm install sync-query-redux
Typescript
Module System
Node Version
NPM Version
68.5
Supply Chain
99.3
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
7,987
Last Day
2
Last Week
30
Last Month
81
Last Year
526
12 Stars
101 Commits
1 Watching
53 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.6
Package Id
sync-query-redux@1.0.6
Unpacked Size
12.93 kB
Size
4.28 kB
File Count
8
NPM Version
6.7.0
Node Version
11.15.0
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
-26.8%
30
Compared to previous week
Last month
1,250%
81
Compared to previous month
Last year
-22.5%
526
Compared to previous year
The library is created for easily synchronization between URL query params and redux state. Inspired by redux-query-sync.
Installation can be done with npm
1npm install --save sync-query-redux
or yarn
1yarn add sync-query-redux
1import { plainSync } from "sync-query-redux"; 2import createHistory from "history/createBrowserHistory"; 3 4const history = createHistory(); 5 6const pathname = "/somePathname"; 7const actionCreator = newQueryString => ({ 8 type: "SOME_ACTION", 9 newQueryString 10}); 11const selector = state => state.queryString; 12const options = { 13 parseQuery: true, 14 stringifyState: true, 15 relyOn: "location", 16 replaceState: true 17}; 18 19const syncer = new plainSync.Syncer(pathname, actionCreator, selector, options); 20const sync = new plainSync.Sync(store, history, syncer); 21const stopSync = sync.start(); // use this function to stop synchronization
The core is Syncer
object, which should be injected into Sync
.
Working example can be found here. You just need to run:
1npm i 2npm run start
or with yarn
1yarn 2yarn start
1type ActionCreator = ( 2 search: string | Object 3) => { type: string, [key: string]: any }; 4 5type Selector = (state: Object) => any; 6 7type Options = { 8 parseQuery?: boolean, 9 stringifyState?: boolean, 10 replaceState?: boolean, 11 relyOn?: "location" | "state" 12}; 13 14interface ISyncer { 15 constructor( 16 pathname: string, 17 actionCreator: ActionCreator, 18 selector: Selector, 19 options: ?Options 20 ): void; 21}
1import type { BrowserHistory as History } from "history/createBrowserHistory"; 2import type { Store } from "redux"; 3import Syncer from "./Syncer"; 4 5interface ISync { 6 constructor(store: Store<any, any>, history: History, syncer: Syncer): void; 7 start(): Function; 8}
Sync
will not have selector and actionCreator, but a list of params where each param will have its selector and its actionCreator.Contributors are welcome. Please discuss new features and submit PRs for bug fixes with tests.
Run npm run build
which detects type errors, tests passing status and build the lib if everything is well.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/14 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
121 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
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