You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
463 B
2 lines
463 B
import{r,P as i,a3 as f}from"./index-f4658ae7.js";function p(a){const o=r(!1),s=r(!1),t=r(!1);let e;const n=new Promise((c,u)=>{i(()=>{e=document.createElement("script"),e.type="text/javascript",e.onload=function(){o.value=!1,t.value=!0,s.value=!1,c("")},e.onerror=function(l){o.value=!1,t.value=!1,s.value=!0,u(l)},e.src=a.src,document.head.appendChild(e)})});return f(()=>{e&&e.remove()}),{isLoading:o,error:s,success:t,toPromise:()=>n}}export{p as useScript};
|