changed from modal to client-side router
This commit is contained in:
18
frontend/src/helperFunctions/loader.ts
Normal file
18
frontend/src/helperFunctions/loader.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import Spinner from '../helperComponents/Spinner.svelte';
|
||||
|
||||
export default (node: any, loading: any) => {
|
||||
let Spin: any
|
||||
loading.subscribe((loading: any) => {
|
||||
if(loading){
|
||||
Spin = new Spinner({
|
||||
target: node,
|
||||
intro: true
|
||||
})
|
||||
} else {
|
||||
if(Spin){
|
||||
Spin?.$destroy?.()
|
||||
Spin = undefined;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user