Something went wrong. Try again.
🔥 🔥 🔥 A Free & Self-hostable Airtable Alternative nocodb.com
Something went wrong. Try again.
456 B · 18 lines
TypeScript
at develop
12345678910111213141516171819export const useLoadingTrigger = () => { const { $state } = useNuxtApp()
return { withLoading: (handler: (param?: any) => Promise<void> | void) => async (param?: any) => { if (param?.shouldShowLoading !== false) { $state.isLoading.value = true } try { await handler(param) } finally { if (param?.shouldShowLoading !== false) { $state.isLoading.value = false } } }, }}