decord/source/5583_useViewRefHandler.js
2026-08-25 06:04:03 +00:00

27 lines
717 B
JavaScript

// Module ID: 5583
// Function ID: 5584
// Name: useViewRefHandler
// Dependencies: [19, 5568]
// Exports: useViewRefHandler
// Module 5583 (useViewRefHandler)
import noop from "noop" /* 19 */;
noop.useCallback;
export const useViewRefHandler = function useViewRefHandler(current, detectorUpdater) {
closure_0 = current;
closure_1 = detectorUpdater;
const items = [current, detectorUpdater];
return useCallback((viewRef) => {
if (null !== viewRef) {
current.viewRef = viewRef;
if (-1 === current.previousViewTag) {
tmp.previousViewTag = current(detectorUpdater[1])(tmp.viewRef);
}
if (!current.firstRender) {
detectorUpdater(true);
}
}
}, items);
};