decord/alpha/source/hooks/useUnmountAbortSignal.tsx

112 lines
3.1 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 6957
// Function ID: 6958
2026-07-20 16:05:17 +00:00
// Name: useUnmountAbortSignal
2026-10-12 06:59:38 +00:00
// Dependencies: [558, 576, 6170, 5396, 2]
2026-07-20 16:05:17 +00:00
2026-10-12 06:59:38 +00:00
// Module 6957 (useUnmountAbortSignal)
2026-10-03 08:58:59 +00:00
import react from "react" /* 576 */;
2026-10-12 06:59:38 +00:00
import useInitialValueDefault from "useInitialValue" /* 6170 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-10-03 08:58:59 +00:00
let tmp;
2026-10-10 08:08:14 +00:00
const useMountEffect = tmp(5396);
2026-10-03 08:58:59 +00:00
let ReactCompilerGating = ReactCompilerGating_mod;
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useUnmountAbortSignal() {
2026-10-03 08:58:59 +00:00
let first;
let tmp6;
const obj = react;
const cResult = obj.c(3);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
2026-10-08 09:57:35 +00:00
const fn = function n() {
2026-10-03 08:58:59 +00:00
const abortController = new AbortController();
return abortController;
};
cResult[0] = fn;
first = fn;
} else {
first = cResult[0];
}
const tmp5 = useInitialValueDefault(first);
let closure_0 = tmp5;
if (cResult[1] !== tmp5) {
const fn2 = function o() {
closure_0.abort();
};
cResult[1] = tmp5;
cResult[2] = fn2;
tmp6 = fn2;
} else {
tmp6 = cResult[2];
}
const tmpResult = useMountEffect;
const unmountEffect = tmpResult.useUnmountEffect(tmp6);
return tmp5.signal;
2026-10-08 09:57:35 +00:00
}) : (function useUnmountAbortSignal() {
2026-08-24 06:08:38 +00:00
const tmp = useInitialValueDefault(() => {
2026-07-20 16:05:17 +00:00
const abortController = new AbortController();
return abortController;
});
2026-10-03 08:58:59 +00:00
let closure_0 = tmp;
const obj = useMountEffect;
const unmountEffect = obj.useUnmountEffect(() => {
2026-08-24 06:08:38 +00:00
closure_0.abort();
2026-07-20 16:05:17 +00:00
});
return tmp.signal;
2026-10-03 08:58:59 +00:00
});
ReactCompilerGating = ReactCompilerGating_mod;
2026-10-08 09:57:35 +00:00
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useUnmountAbortSignalWithDelay(arg0) {
2026-10-03 08:58:59 +00:00
let first;
let closure_0 = arg0;
const obj = react;
const cResult = obj.c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
2026-10-08 09:57:35 +00:00
const fn = function t() {
2026-10-03 08:58:59 +00:00
const abortController = new AbortController();
return abortController;
};
cResult[0] = fn;
first = fn;
} else {
first = cResult[0];
}
const tmp5 = useInitialValueDefault(first);
let closure_1 = tmp5;
if (cResult[1] === tmp5) {
let tmp6;
if (cResult[2] === arg0) {
tmp6 = cResult[3];
}
const tmpResult = useMountEffect;
const unmountEffect = tmpResult.useUnmountEffect(tmp6);
return tmp5.signal;
}
2026-10-08 09:57:35 +00:00
const fn2 = function u() {
2026-10-03 08:58:59 +00:00
const timerId = setTimeout(() => {
closure_1_1.abort();
}, closure_0);
};
cResult[1] = tmp5;
cResult[2] = arg0;
cResult[3] = fn2;
tmp6 = fn2;
2026-10-08 09:57:35 +00:00
}) : (function useUnmountAbortSignalWithDelay(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg0;
2026-08-24 06:08:38 +00:00
const tmp = useInitialValueDefault(() => {
2026-07-20 16:05:17 +00:00
const abortController = new AbortController();
return abortController;
});
2026-10-03 08:58:59 +00:00
let closure_1 = tmp;
const obj = useMountEffect;
const unmountEffect = obj.useUnmountEffect(() => {
2026-07-20 16:05:17 +00:00
const timerId = setTimeout(() => {
closure_1_1.abort();
2026-07-23 10:11:24 +00:00
}, closure_0);
2026-07-20 16:05:17 +00:00
});
return tmp.signal;
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("hooks/useUnmountAbortSignal.tsx");
export default tmp2;
export const useUnmountAbortSignalWithDelay = tmp3;