1
0
2024-02-07 14:56:56 +01:00

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)
}
}