import{r as u}from"./@vue.ad3a2c51.js";function f(t){const{apiFn:a,onSuccess:e,onError:s}=t,r=u(!1);return{loading:r,runFn:async(...o)=>{r.value=!0;try{const n=await a(...o);e&&e(n)}catch(n){s&&s(n)}finally{r.value=!1}}}}export{f as u};