Gathering detailed insights and metrics for mobx-react-router-utils
Gathering detailed insights and metrics for mobx-react-router-utils
Gathering detailed insights and metrics for mobx-react-router-utils
Gathering detailed insights and metrics for mobx-react-router-utils
npm install mobx-react-router-utils
Typescript
Module System
Node Version
NPM Version
44.9
Supply Chain
84.2
Quality
76.3
Maintenance
50
Vulnerability
98.9
License
TypeScript (100%)
Total Downloads
52,625
Last Day
1
Last Week
5
Last Month
222
Last Year
2,597
66 Commits
3 Forks
4 Watching
4 Branches
4 Contributors
Latest Version
4.2.0
Package Id
mobx-react-router-utils@4.2.0
Unpacked Size
37.46 kB
Size
10.16 kB
File Count
18
NPM Version
8.19.3
Node Version
16.19.0
Publised On
25 Apr 2023
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-90%
5
Compared to previous week
Last month
24%
222
Compared to previous month
Last year
-67.9%
2,597
Compared to previous year
18
3
7
Routing utils to use with RouterStore (from mobx-react-router
) on your MobX stores.
yarn add mobx-react-router-utils
1import { computedRouteParam, setRoutingStore } from 'mobx-react-router-utils' 2 3// Set the reference to your routing store before any usage 4// You ony need to this once in your application 5setRoutingStore(routingStore) 6 7const routes = { 8 search: '/search', 9 citySearch: '/cities/:city' 10} 11 12class DemoSearchStore { 13 city = computedRouteParam('city', { 14 patterns: [routes.citySearch], 15 }) 16 17 // this one will come from the query string 18 checkIn = computedRouteParam('checkIn', { 19 // Define the route patterns for which this one is valid 20 patterns: [routes.search, routes.citySearch], 21 22 // Set a parsing fn to transform from string 23 parse: _parseDate, 24 25 // Set a formatting fn to transform into string 26 format: _formatDate, 27 28 // It'll return the default value in case it's 29 // not present on the route or with an empty value 30 defaultValue: 'temecula' 31 }) 32 33 checkOut = computedRouteParam('checkOut', { 34 patterns: [routes.search, routes.citySearch], 35 parse: _parseDate, 36 format: _formatDate, 37 }) 38 39 setCity = (city: Maybe<string>) => { 40 // For updating the current route, push() and replace() methods are available: 41 // - push: will add the new url to the browsing history 42 // - replace: will replace the current url on the browsing history 43 this.city.push(city, { 44 // enforce a route pattern if needed, otherwise, it will use the 45 // current location (if matches the config) or first pattern available 46 pattern: !city && routes.search, 47 48 // cleanup all other params (default: false) 49 cleanParams: true, 50 51 // OR cleanup only selected params 52 cleanParams: [ 53 this.checkIn, 54 this.checkOut 55 ] 56 }) 57 } 58 59 setPeriod = (checkIn: Maybe<Date>, checkOut: Maybe<Date>) => { 60 this.checkIn.push(checkIn) 61 this.checkOut.replace(checkOut) 62 } 63 64 // ... 65}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 4/15 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
license file not detected
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
17 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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