decord/source/hooks/useInterval.tsx

39 lines
1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7052
// Function ID: 7053
2026-07-20 16:05:17 +00:00
// Name: useInterval
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 38, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 7052 (useInterval)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import noop from "noop" /* 19 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
({ useEffect: obj1, useRef: c3 } = noop);
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("hooks/useInterval.tsx");
2026-07-20 16:05:17 +00:00
export default function useInterval(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const callback = callback2(arg0);
2026-07-23 10:11:24 +00:00
callback2 = callback2(null);
2026-07-20 16:05:17 +00:00
const items = [arg0];
callback(() => {
2026-07-23 10:11:24 +00:00
closure_2.current = closure_0;
2026-07-20 16:05:17 +00:00
}, items);
const items1 = [arg1];
callback(() => {
2026-07-23 10:11:24 +00:00
if (null !== closure_1) {
2026-07-20 16:05:17 +00:00
const _setInterval = setInterval;
ref.current = setInterval(() => {
2026-08-24 06:08:38 +00:00
closure_1_0(closure_1_1[1])(null != ref.current, "Missing callback");
2026-07-29 08:29:29 +00:00
ref.current();
}, tmp);
return () => clearInterval(ref2.current);
2026-07-20 16:05:17 +00:00
} else if (null !== ref.current) {
const _clearInterval = clearInterval;
2026-07-29 08:29:29 +00:00
clearInterval(tmp2.current);
tmp2.current = null;
2026-07-20 16:05:17 +00:00
}
}, items1);
};