We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useStore
1 parent b273427 commit d367145Copy full SHA for d367145
README.md
@@ -33,7 +33,7 @@ router.push('/login');
33
|Declaration|Description|
34
|-|-|
35
|`createStore`<S>(options: StoreOptions<S>): Store<S>||
36
-|`useStore`<S = any>(): Store<S> \| undefined||
+|`useStore`<S = any>(): Store<S>|
37
38
### vue2-helpers/vue-router
39
src/vuex.ts
@@ -10,11 +10,12 @@ export function createStore<S>(options: StoreOptions<S>) {
10
}
11
12
13
-export function useStore<S = any>() {
+export function useStore<S = any>(): Store<S> {
14
const inst = getCurrentInstance()
15
if (inst) {
16
- return inst.proxy.$store as Store<S>
+ return inst.proxy.$store
17
} else {
18
warn(OUT_OF_SCOPE)
19
20
+ return undefined as any
21
0 commit comments