feat: improved types #2547

Merged
konrad merged 17 commits from dpschen/frontend:feature/improved-types into main 2022-11-02 16:06:57 +00:00
1 changed files with 1 additions and 3 deletions
Showing only changes of commit 35f4bb1385 - Show all commits

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