Gathering detailed insights and metrics for vuex-enhanced-router-sync
Gathering detailed insights and metrics for vuex-enhanced-router-sync
Gathering detailed insights and metrics for vuex-enhanced-router-sync
Gathering detailed insights and metrics for vuex-enhanced-router-sync
npm install vuex-enhanced-router-sync
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
39 Commits
2 Watching
14 Branches
2 Contributors
Updated on 28 May 2021
TypeScript (55.99%)
JavaScript (44.01%)
Cumulative downloads
Total Downloads
Last day
125%
9
Compared to previous day
Last week
106.5%
64
Compared to previous week
Last month
71.4%
144
Compared to previous month
Last year
-4.8%
1,337
Compared to previous year
This package replaces vuex-router-sync
and adds some useful features.
I dislike the fact that vuex-router-sync
replaces the store state instead of updating it. This leads to the recomputation of all computed properties and getters related to the router state, even though it isn't really necessary.
Let's say you have a very expensive getter that depends on on the ?search=foo
query parameter and takes 1 second to complete. The user then clicks on a search result and &open=1
is added to the query. vuex-enhanced-router-sync
leaves search
alone and updates open
while vuex-router-sync
would update both search
and open
, which leads to longer blocking of the UI.
1npm install vuex-enhanced-router-sync 2# or 3yarn add vuex-enhanced-router-sync
See vue-router-sync
1import { sync } from "vuex-enhanced-router-sync"; 2 3sync(store, router, { immutable: false, moduleName: "route" }); 4// or 5sync(store, router, "route"); // only supply moduleName 6// or 7sync(store, router); // default options
You should not modify the store state. Instead, use $router.push()
and $router.go()
to update the current route.
store: Store<any>
router: VueRouter
options: string | options
(optional)
immutable: boolean
(default false
)
Set this to true if you want vuex-enhanced-router-sync to treat the state like an immutable object.
moduleName: string
(default "route"
)
The state can be accessed via vm.$store.state.<module name>.path
. See below for all available properties. This can also be set by supplying a string to options.
From vue-router:
store.state.<module name>
name: string
: The name of the current route, if it has one.path: string
: A string that equals the path of the current route.hash: string
: The hash of the current route.fullPath: string
: The full resolved URL including query and hash.query: object
: An object that contains key/value pairs of the query string.params: object
: An object that contains key/value pairs of dynamic segments and star segments.meta: object
: The meta of the current route.from: object
: The previous route.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/4 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
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
65 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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