This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/stores/helper.ts

9 lines
233 B
TypeScript

const LOADING_TIMEOUT = 100
export function setModuleLoading(loadFunc: (isLoading: boolean) => void) {
const timeout = setTimeout(() => loadFunc(true), LOADING_TIMEOUT)
return () => {
clearTimeout(timeout)
loadFunc(false)
}
}