decord/alpha/source/hooks/useDebounce.tsx

66 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 13567
// Function ID: 13568
2026-07-20 16:05:17 +00:00
// Name: useDebounce
2026-10-03 08:58:59 +00:00
// Dependencies: [32, 19, 558, 576, 2]
2026-07-20 16:05:17 +00:00
2026-10-08 09:57:35 +00:00
// Module 13567 (useDebounce)
2026-10-03 08:58:59 +00:00
import react2 from "react" /* 576 */;
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useDebounce(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
const obj = react2;
const cResult = obj.c(4);
let closure_2 = _slicedToArray(react.useState(arg0), 2)[1];
_slicedToArray(react.useState(arg0), 2);
const obj2 = react;
if (cResult[0] === arg1) {
let tmp4;
let tmp5;
if (cResult[1] === arg0) {
tmp4 = cResult[2];
tmp5 = cResult[3];
}
const effect = obj2.useEffect(tmp4, tmp5);
return tmp3;
}
const fn = function s() {
const timeout = setTimeout(() => {
closure_1_2(closure_0);
}, closure_1);
return () => {
clearTimeout(closure_0);
};
};
const items = [arg0, arg1];
cResult[0] = arg1;
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items;
tmp5 = items;
tmp4 = fn;
2026-10-08 09:57:35 +00:00
}) : (function useDebounce(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let closure_2;
let first;
let closure_0 = arg0;
let closure_1 = arg1;
[first, closure_2] = react.useState(arg0);
2026-07-20 16:05:17 +00:00
const items = [arg0, arg1];
2026-10-03 08:58:59 +00:00
const effect = react.useEffect(() => {
2026-07-20 16:05:17 +00:00
const timeout = setTimeout(() => {
closure_1_2(closure_0);
2026-08-24 06:08:38 +00:00
}, closure_1);
2026-07-20 16:05:17 +00:00
return () => {
2026-08-24 06:08:38 +00:00
clearTimeout(closure_0);
2026-07-20 16:05:17 +00:00
};
}, items);
2026-10-03 08:58:59 +00:00
return first;
});
const result = size.fileFinishedImporting("hooks/useDebounce.tsx");
export default tmp2;