Closed fuergaosi233 closed 4 years ago
async function loader(fn,process,...args){ // process:{start,loding,sucess} runtime info const spinner = ora(process.start||`start`).start(); spinner.text = `${process.loding||'loding'}`; try{ let res = await fn(...args) spinner.succeed(process.success||`success`) return res }catch(err){ spinner.fail(process.fail||'fail'); throw err; } }
When i useloader to run async function , the spinner will freezes likes this: So what should I do for solve this problem.
loader
I change my sync function to async function then solved it.
This is documented in the readme (at the bottom).
When i use
loader
to run async function , the spinner will freezes likes this: So what should I do for solve this problem.