decord/source/modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

32 lines
940 B
TypeScript

// Module ID: 14966
// Function ID: 14967
// Name: useRefreshLinkCodeOnExpiry
// Dependencies: [19, 7065, 2]
// Exports: default
// Module 14966 (useRefreshLinkCodeOnExpiry)
import useStableCallbackDefault from "useStableCallback" /* 7065 */;
import noop from "module_19" /* 19 */;
const size = fn(2);
const result = size.fileFinishedImporting("modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx");
export default function useRefreshLinkCodeOnExpiry(arg0, arg1) {
closure_0 = arg0;
const tmp = useStableCallbackDefault(arg1);
closure_1 = tmp;
const items = [arg0, tmp];
const effect = noop.useEffect(() => {
if (null != timeout) {
const _Date = Date;
const diff = tmp - Date.now();
if (diff <= 0) {
closure_1();
} else {
const _setTimeout = setTimeout;
timeout = setTimeout(closure_1, diff);
return () => clearTimeout(closure_0);
}
}
}, items);
};