UNPKG

mmjs-core

Version:
2 lines (1 loc) 358 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(i,l,o){let t;const{immediate:r=!0}=o??{};let e=i;function c(){e=null,t&&(clearTimeout(t),t=void 0)}function s(){e=i,n()}function n(){t=setTimeout(()=>{var u;(u=e==null?void 0:e())==null||u.finally(n)},l)}return r&&n(),{pause:c,resume:s}}exports.useAsyncIntervalFn=a;