decord/source/__polyfill/07xxx/module_7015.js
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

70 lines
2 KiB
JavaScript

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