版博士V2.0程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

19 satır
441 B

  1. import { tryOnScopeDispose } from '@vueuse/core';
  2. function useTimeout() {
  3. let timeoutHandle;
  4. const registerTimeout = (fn, delay) => {
  5. cancelTimeout();
  6. timeoutHandle = window.setTimeout(fn, delay);
  7. };
  8. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  9. tryOnScopeDispose(() => cancelTimeout());
  10. return {
  11. registerTimeout,
  12. cancelTimeout
  13. };
  14. }
  15. export { useTimeout };
  16. //# sourceMappingURL=index.mjs.map