decord/source/5399_useViewRefHandler.js

26 lines
701 B
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5399
// Function ID: 5400
2026-07-23 10:11:24 +00:00
// Name: useViewRefHandler
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 5379]
2026-07-23 10:11:24 +00:00
// Exports: useViewRefHandler
2026-08-05 07:35:12 +00:00
// Module 5399 (useViewRefHandler)
2026-07-29 08:29:29 +00:00
require("noop").useCallback;
2026-07-23 10:11:24 +00:00
export const useViewRefHandler = function useViewRefHandler(current, detectorUpdater) {
let closure_0 = current;
let closure_1 = detectorUpdater;
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);
};