fix: setModuleLoading LoadingState type
This commit is contained in:
parent
0b58973d87
commit
35f4bb1385
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user