Update return type of `useStore`

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
Phillip Rak 2024-06-08 14:10:36 -07:00
parent 6fbc8668a7
commit c4721774a6
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { getCurrentInstance } from 'vue'; import { getCurrentInstance } from 'vue';
import { Store } from 'vuex';
/** /**
* useStore allows for accessing Vuex stores from within a setup function. This is a temporary measure for working with * useStore allows for accessing Vuex stores from within a setup function. This is a temporary measure for working with
@ -6,7 +7,7 @@ import { getCurrentInstance } from 'vue';
* *
* TODO: #9541 Remove for Vue 3 migration * TODO: #9541 Remove for Vue 3 migration
*/ */
export const useStore = ():unknown => { export const useStore = ():Store<any> => {
const vm = getCurrentInstance(); const vm = getCurrentInstance();
if (!vm) throw new Error('useStore() must be called from setup()'); if (!vm) throw new Error('useStore() must be called from setup()');