Public
Authored by 毛朋超

自定义hooks-useAsync

const { run, isLoading } = useAsync();

run中传入promise,会自动执行该异步函数。同时自动管理该异步函数的 loading , success, error 等状态。

Edited
useAsync.ts 1.47 KB
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment