flaschengeist-frontend/api/src/utils/loading.ts

12 lines
302 B
TypeScript

import { watch, WatchSource } from 'vue';
import { LoadingBar } from 'quasar';
function setLoadingBar(loading: WatchSource<boolean>) {
return watch<boolean>(loading, (loading) => {
if (loading) LoadingBar.start(10000);
if (!loading) LoadingBar.stop();
});
}
export default setLoadingBar;