const e=(e,t,r="error")=>{let n,i;const s=new Promise((e,t)=>{n=e,i=t});return e.addEventListener(t,n),e.addEventListener(r,i),s.finally(()=>{e.removeEventListener(t,n),e.removeEventListener(r,i)}),s},t=e=>new Promise(t=>setTimeout(t,e)),r=async(e,n={})=>{const{maxTries:i=10,interval:s=10}=n;if(i<=0)throw void 0;e()||(await t(s),await r(e,{maxTries:i-1,interval:s}))};export{e as eventOn,r as polling,t as timeout};
//# sourceMappingURL=callforth.modern.js.map
