decord/source/5543_useOnLoad.js

78 lines
2 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5543
// Function ID: 5544
2026-07-29 08:29:29 +00:00
// Name: useOnLoad
2026-08-05 07:35:12 +00:00
// Dependencies: [5496, 19, 5541]
2026-07-29 08:29:29 +00:00
// Exports: useOnListLoad
2026-08-05 07:35:12 +00:00
// Module 5543 (useOnLoad)
2026-07-29 08:29:29 +00:00
import _slicedToArray from "_slicedToArray";
import noop from "noop";
let c3;
let c4;
let c5;
let closure_6;
const require = arg1;
({ useEffect: c3, useMemo: c4, useRef: c5, useState: closure_6 } = noop);
function useOnLoad(arg0, arg1) {
let closure_0 = arg0;
let closure_1 = arg1;
let _slicedToArray = callback3(false);
callback2(() => {
let isFirstLayoutComplete = getDataLength.getIsFirstLayoutComplete();
if (isFirstLayoutComplete) {
isFirstLayoutComplete = !ref.current;
}
if (isFirstLayoutComplete) {
ref.current = true;
2026-08-05 07:35:12 +00:00
f76698();
2026-07-29 08:29:29 +00:00
}
});
}
export const useOnListLoad = (getDataLength) => {
let closure_3;
let tmp3;
let _require = getDataLength;
2026-08-05 07:35:12 +00:00
let f76698 = arg1;
2026-07-29 08:29:29 +00:00
let callback = callback3(Date.now());
[tmp3, closure_3] = callback(callback4(false), 2);
const dataLength = getDataLength.getDataLength();
const tmp = callback3;
const tmp2 = callback(callback4(false), 2);
2026-08-05 07:35:12 +00:00
const requestAnimationFrame = _require(f76698[2]).useUnmountAwareAnimationFrame().requestAnimationFrame;
2026-07-29 08:29:29 +00:00
const items = [dataLength];
requestAnimationFrame(() => {
_slicedToArray.current = Date.now();
}, items);
2026-08-04 21:03:28 +00:00
if (typeof useOnLoad !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
}
_require = getDataLength;
2026-08-05 07:35:12 +00:00
f76698 = () => {
2026-07-29 08:29:29 +00:00
let closure_0 = Date.now() - ref.current;
requestAnimationFrame(() => {
closure_0.isFirstPaintOnUiComplete = true;
if (outer1_1 != null) {
const obj = { elapsedTimeInMs: null };
obj[0] = closure_0;
tmp(obj);
}
outer1_3(true);
});
};
callback = tmp(false);
callback2(() => {
let isFirstLayoutComplete = getDataLength.getIsFirstLayoutComplete();
if (isFirstLayoutComplete) {
isFirstLayoutComplete = !ref.current;
}
if (isFirstLayoutComplete) {
ref.current = true;
2026-08-05 07:35:12 +00:00
f76698();
2026-07-29 08:29:29 +00:00
}
});
return { isLoaded };
};
export { useOnLoad };