decord/source/__polyfill/06xxx/module_6918.js
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

70 lines
2 KiB
JavaScript

// Module ID: 6918
// Function ID: 6919
// Dependencies: [6871, 19, 6916]
// Exports: useOnListLoad
// Module 6918
import _mod6916 from "module_6916" /* 6916 */;
import _slicedToArray from "module_6871" /* 6871 */;
require = fn;
const noop = fn(19);
({ useEffect: c3, useMemo: closure_4, useRef: hasOwnProperty, useState: metroRequire } = noop);
function useOnLoad(arg0, arg1) {
closure_0 = arg0;
closure_1 = arg1;
closure_2 = hasOwnProperty(false);
React3(() => {
let isFirstLayoutComplete = getDataLength.getIsFirstLayoutComplete();
if (isFirstLayoutComplete) {
isFirstLayoutComplete = !ref.current;
}
if (isFirstLayoutComplete) {
ref.current = true;
f80944();
}
});
}
export const useOnListLoad = (getDataLength, arg1) => {
let f80944 = arg1;
hasOwnProperty(Date.now());
[tmp3, closure_3] = timestampProducer(false);
const dataLength = getDataLength.getDataLength();
const tmp = hasOwnProperty;
const tmp2 = _slicedToArray(timestampProducer(false), 2);
const requestAnimationFrame = _mod6916.useUnmountAwareAnimationFrame().requestAnimationFrame;
const items = [dataLength];
React4(() => {
closure_2.current = Date.now();
}, items);
if (typeof useOnLoad === "function") {
f80944 = () => {
const elapsedTimeInMs = Date.now() - ref.current;
requestAnimationFrame(() => {
elapsedTimeInMs.isFirstPaintOnUiComplete = true;
if (f80944 != null) {
const obj = { elapsedTimeInMs };
tmp(obj);
}
closure_2_3(true);
});
};
tmp(false);
React3(() => {
let isFirstLayoutComplete = getDataLength.getIsFirstLayoutComplete();
if (isFirstLayoutComplete) {
isFirstLayoutComplete = !ref.current;
}
if (isFirstLayoutComplete) {
ref.current = true;
f80944();
}
});
const obj2 = { isLoaded: tmp3 };
return obj2;
} else {
throw new TypeError("Trying to call a non-function");
}
};
export { useOnLoad };