(fn, options = {})
| 22 | * @returns 返回一个新的函数,该函数返回一个 Promise |
| 23 | */ |
| 24 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected