decord/source/modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx

33 lines
940 B
TypeScript
Raw Normal View History

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