decord/source/6458_useViewRefHandler.js

28 lines
717 B
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6458
// Function ID: 6459
2026-07-23 10:11:24 +00:00
// Name: useViewRefHandler
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 6443]
2026-07-23 10:11:24 +00:00
// Exports: useViewRefHandler
2026-08-24 06:08:38 +00:00
// Module 6458 (useViewRefHandler)
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);
};