fix(util/create-async-process): pass arguments

This commit is contained in:
Sándor Levcsák 2020-10-23 06:41:11 +03:00
parent b01d737325
commit 916291bf9d
1 changed files with 2 additions and 2 deletions

View File

@ -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
}