30 lines
860 B
TypeScript
30 lines
860 B
TypeScript
// Module ID: 13843
|
|
// Function ID: 106115
|
|
// Name: useRefreshLinkCodeOnExpiry
|
|
// Dependencies: [31, 8193, 2]
|
|
// Exports: default
|
|
|
|
// Module 13843 (useRefreshLinkCodeOnExpiry)
|
|
import result from "result";
|
|
|
|
const result = require("set").fileFinishedImporting("modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx");
|
|
|
|
export default function useRefreshLinkCodeOnExpiry(arg0, arg1) {
|
|
const importDefault = arg0;
|
|
const tmp = importDefault(8193)(arg1);
|
|
const dependencyMap = tmp;
|
|
const items = [arg0, tmp];
|
|
const effect = React.useEffect(() => {
|
|
if (null != timeout) {
|
|
const _Date = Date;
|
|
const diff = timeout - Date.now();
|
|
if (diff <= 0) {
|
|
tmp();
|
|
} else {
|
|
const _setTimeout = setTimeout;
|
|
timeout = setTimeout(tmp, diff);
|
|
return () => clearTimeout(closure_0);
|
|
}
|
|
}
|
|
}, items);
|
|
};
|