Skip to content

Function: useAppStore()

useAppStore(pinia?, hot?): Store<"app", Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "isMobile" | "showLoading">, Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "themeColor" | "isDark" | "showToggleLocale">, Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "toggleDark" | "toggleDarkWithTransition">>

Defined in: packages/valaxy/client/stores/app.ts:13

Global store for users

Parameters

pinia?

Pinia instance to retrieve the store

null | Pinia

hot?

StoreGeneric

dev only hot module replacement

Returns

Store<"app", Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "isMobile" | "showLoading">, Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "themeColor" | "isDark" | "showToggleLocale">, Pick<{ isDark: WritableComputedRef<boolean, boolean>; isMobile: Ref<boolean, boolean>; showLoading: Ref<boolean, boolean>; showToggleLocale: ComputedRef<boolean>; themeColor: ComputedRef<string>; toggleDark: (value?) => boolean; toggleDarkWithTransition: (event, options) => void; }, "toggleDark" | "toggleDarkWithTransition">>

Example

ts
import { useAppStore } from 'valaxy'
const appStore = useAppStore()