decord/beta/source/hooks/useInterval.tsx
github-actions 9b6fea255e chore: update source for beta 346.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-18 19:45:33 +00:00

37 lines
1,022 B
TypeScript

// Module ID: 7548
// Function ID: 7549
// Name: useInterval
// Dependencies: [19, 38, 2]
// Exports: default
// Module 7548 (useInterval)
import noop from "module_19" /* 19 */;
import size from "module_2" /* 2 */;
({ useEffect: c2, useRef: c3 } = noop);
const result = size.fileFinishedImporting("hooks/useInterval.tsx");
export default function useInterval(current, arg1) {
closure_1 = arg1;
closure_2 = ref(current);
ref = ref(null);
const items = [current];
closure_2(() => {
closure_2.current = current;
}, items);
const items1 = [arg1];
closure_2(() => {
if (null !== closure_1) {
const _setInterval = setInterval;
ref.current = setInterval(() => {
closure_0(closure_1[1])(null != ref.current, "Missing callback");
ref.current();
}, tmp);
return () => clearInterval(ref2.current);
} else if (null !== ref.current) {
const _clearInterval = clearInterval;
clearInterval(tmp2.current);
tmp2.current = null;
}
}, items1);
};