fix: setModuleLoading LoadingState type

This commit is contained in:
Dominik Pschenitschni 2022-10-17 13:54:38 +02:00
parent 0b58973d87
commit 35f4bb1385
Signed by: dpschen
GPG Key ID: B257AC0149F43A77
1 changed files with 1 additions and 3 deletions

View File

@ -1,12 +1,10 @@
import type { StoreDefinition } from 'pinia'
export interface LoadingState {
isLoading: boolean
}
const LOADING_TIMEOUT = 100
export const setModuleLoading = <LoadingStore extends StoreDefinition<string, LoadingState>>(store: LoadingStore, loadFunc : ((isLoading: boolean) => void) | null = null) => {
export const setModuleLoading = <Store extends LoadingState>(store: Store, loadFunc : ((isLoading: boolean) => void) | null = null) => {
const timeout = setTimeout(() => {
if (loadFunc === null) {
store.isLoading = true