decord/source/hooks/useTimeout.tsx

33 lines
797 B
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 7415
// Function ID: 7416
2026-07-20 16:05:17 +00:00
// Name: useTimeout
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-08 06:10:11 +00:00
// Module 7415 (useTimeout)
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c0;
let closure_1;
({ useEffect: c0, useRef: closure_1 } = noop);
const result = require("set").fileFinishedImporting("hooks/useTimeout.tsx");
2026-07-20 16:05:17 +00:00
export default function useTimeout(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
const callback2 = arg1;
const tmp = callback2(arg0);
let closure_2 = tmp;
2026-07-20 16:05:17 +00:00
const items = [arg0];
2026-07-23 10:11:24 +00:00
callback(() => {
closure_2.current = closure_0;
2026-07-20 16:05:17 +00:00
}, items);
const items1 = [arg1, tmp];
2026-07-23 10:11:24 +00:00
callback(() => {
if (null !== closure_1) {
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
const timeout = setTimeout(() => ref.current(), tmp);
2026-07-20 16:05:17 +00:00
return () => clearTimeout(closure_0);
}
}, items1);
};