fix(util/create-async-process): pass arguments
This commit is contained in:
parent
b01d737325
commit
916291bf9d
|
|
@ -3,9 +3,9 @@ import { ref } from 'vue'
|
|||
export default function createAsyncProcess<T extends (...args: any) => Promise<any>> (fn: T) {
|
||||
const active = ref<boolean>(false)
|
||||
|
||||
async function run (): Promise<ReturnType<T>> {
|
||||
async function run (...args : any): Promise<ReturnType<T>> {
|
||||
active.value = true
|
||||
const result = await fn()
|
||||
const result = await fn(...args)
|
||||
active.value = false
|
||||
return result
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue