decord/source/5583_useViewRefHandler.js

28 lines
717 B
JavaScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5583
// Function ID: 5584
2026-07-23 10:11:24 +00:00
// Name: useViewRefHandler
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 5568]
2026-07-23 10:11:24 +00:00
// Exports: useViewRefHandler
2026-08-25 06:04:03 +00:00
// Module 5583 (useViewRefHandler)
2026-08-24 06:08:38 +00:00
import noop from "noop" /* 19 */;
noop.useCallback;
2026-07-23 10:11:24 +00:00
export const useViewRefHandler = function useViewRefHandler(current, detectorUpdater) {
2026-08-24 06:08:38 +00:00
closure_0 = current;
closure_1 = detectorUpdater;
2026-07-23 10:11:24 +00:00
const items = [current, detectorUpdater];
return useCallback((viewRef) => {
if (null !== viewRef) {
current.viewRef = viewRef;
if (-1 === current.previousViewTag) {
2026-07-29 08:29:29 +00:00
tmp.previousViewTag = current(detectorUpdater[1])(tmp.viewRef);
2026-07-23 10:11:24 +00:00
}
if (!current.firstRender) {
detectorUpdater(true);
}
}
}, items);
};