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

32 lines
895 B
TypeScript
Raw Normal View History

2026-09-01 10:26:29 +00:00
// Module ID: 14483
// Function ID: 14484
2026-07-20 16:05:17 +00:00
// Name: useRefreshLinkCodeOnExpiry
2026-09-01 10:26:29 +00:00
// Dependencies: [19, 7737, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-09-01 10:26:29 +00:00
// Module 14483 (useRefreshLinkCodeOnExpiry)
import setDefault from "set" /* 7737 */;
2026-08-24 06:08:38 +00:00
import closure_2 from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx");
2026-07-20 16:05:17 +00:00
export default function useRefreshLinkCodeOnExpiry(arg0, arg1) {
2026-08-24 06:08:38 +00:00
importDefault = arg0;
const tmp = setDefault(arg1);
dependencyMap = tmp;
2026-07-20 16:05:17 +00:00
const items = [arg0, tmp];
const effect = React.useEffect(() => {
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) {
2026-08-24 06:08:38 +00:00
callback();
2026-07-20 16:05:17 +00:00
} else {
const _setTimeout = setTimeout;
2026-08-24 06:08:38 +00:00
timeout = setTimeout(callback, diff);
2026-07-20 16:05:17 +00:00
return () => clearTimeout(closure_0);
}
}
}, items);
};