decord/source/__polyfill/07xxx/module_7005.js
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

70 lines
2 KiB
JavaScript

// Module ID: 7005
// Function ID: 7006
// Dependencies: [6958, 19, 7003]
// Exports: useOnListLoad
// Module 7005
import _mod7003 from "module_7003" /* 7003 */;
import _slicedToArray from "module_6958" /* 6958 */;
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;
f81293();
}
});
}
export const useOnListLoad = (getDataLength, arg1) => {
let f81293 = arg1;
hasOwnProperty(Date.now());
[tmp3, closure_3] = timestampProducer(false);
const dataLength = getDataLength.getDataLength();
const tmp = hasOwnProperty;
const tmp2 = _slicedToArray(timestampProducer(false), 2);
const requestAnimationFrame = _mod7003.useUnmountAwareAnimationFrame().requestAnimationFrame;
const items = [dataLength];
React4(() => {
closure_2.current = Date.now();
}, items);
if (typeof useOnLoad === "function") {
f81293 = () => {
const elapsedTimeInMs = Date.now() - ref.current;
requestAnimationFrame(() => {
elapsedTimeInMs.isFirstPaintOnUiComplete = true;
if (f81293 != 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;
f81293();
}
});
const obj2 = { isLoaded: tmp3 };
return obj2;
} else {
throw new TypeError("Trying to call a non-function");
}
};
export { useOnLoad };