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.

1 line
1.5 KiB

{"ast":null,"code":"import { tryOnScopeDispose } from '@vueuse/core';\nfunction useTimeout() {\n let timeoutHandle;\n const registerTimeout = (fn, delay) => {\n cancelTimeout();\n timeoutHandle = window.setTimeout(fn, delay);\n };\n const cancelTimeout = () => window.clearTimeout(timeoutHandle);\n tryOnScopeDispose(() => cancelTimeout());\n return {\n registerTimeout,\n cancelTimeout\n };\n}\nexport { useTimeout };","map":{"version":3,"names":["useTimeout","timeoutHandle","registerTimeout","fn","delay","cancelTimeout","window","setTimeout","clearTimeout","tryOnScopeDispose"],"sources":["../../../../../packages/hooks/use-timeout/index.ts"],"sourcesContent":["import { tryOnScopeDispose } from '@vueuse/core'\n\nexport function useTimeout() {\n let timeoutHandle: number\n\n const registerTimeout = (fn: (...args: any[]) => any, delay: number) => {\n cancelTimeout()\n timeoutHandle = window.setTimeout(fn, delay)\n }\n const cancelTimeout = () => window.clearTimeout(timeoutHandle)\n\n tryOnScopeDispose(() => cancelTimeout())\n\n return {\n registerTimeout,\n cancelTimeout,\n }\n}\n"],"mappings":";AACO,SAASA,UAAUA,CAAA,EAAG;EAC3B,IAAIC,aAAa;EACjB,MAAMC,eAAe,GAAGA,CAACC,EAAE,EAAEC,KAAK,KAAK;IACrCC,aAAa,EAAE;IACfJ,aAAa,GAAGK,MAAM,CAACC,UAAU,CAACJ,EAAE,EAAEC,KAAK,CAAC;EAChD,CAAG;EACD,MAAMC,aAAa,GAAGA,CAAA,KAAMC,MAAM,CAACE,YAAY,CAACP,aAAa,CAAC;EAC9DQ,iBAAiB,CAAC,MAAMJ,aAAa,EAAE,CAAC;EACxC,OAAO;IACLH,eAAe;IACfG;EACJ,CAAG;AACH","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}