decord/source/hooks/useInterval.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

37 lines
1,022 B
TypeScript

// Module ID: 7518
// Function ID: 7519
// Name: useInterval
// Dependencies: [19, 38, 2]
// Exports: default
// Module 7518 (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);
};