Installations
npm install mobx-react-router-utils
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.19.0
NPM Version
8.19.3
Score
44.9
Supply Chain
84.2
Quality
76.3
Maintenance
50
Vulnerability
98.9
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
wellguimaraes
Download Statistics
Total Downloads
52,625
Last Day
1
Last Week
5
Last Month
222
Last Year
2,597
GitHub Statistics
66 Commits
3 Forks
4 Watching
4 Branches
4 Contributors
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
52,625
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
18
Peer Dependencies
3
Dev Dependencies
7
MobX React Router Utils
Routing utils to use with RouterStore (from mobx-react-router
) on your MobX stores.
Install it
yarn add mobx-react-router-utils
Use it
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Reason
17 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.6
/10
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