MCPcopy Create free account
hub / github.com/chunshand/qdev / useFullscreenLoading

Function useFullscreenLoading

admin/src/hooks/useFullscreenLoading.ts:24–34  ·  view source on GitHub ↗
(fn, options = {})

Source from the content-addressed store, hash-verified

22 * @returns 返回一个新的函数,该函数返回一个 Promise
23 */
24export const useFullscreenLoading: UseFullscreenLoading = (fn, options = {}) => {
25 let loadingInstance: LoadingInstance
26 return async (...args) => {
27 try {
28 loadingInstance = ElLoading.service({ ...defaultOptions, ...options })
29 return await fn(...args)
30 } finally {
31 loadingInstance?.close()
32 }
33 }
34}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected