decord/source/1843_useEventHandlerRegistration.js

61 lines
2.1 KiB
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1843
// Function ID: 1844
2026-07-29 08:29:29 +00:00
// Name: useEventHandlerRegistration
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 17, 1844]
2026-07-29 08:29:29 +00:00
// Exports: useAnimatedValue, useEventHandlerRegistration
2026-08-15 05:55:55 +00:00
// Module 1843 (useEventHandlerRegistration)
2026-08-24 06:08:38 +00:00
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import noop from "noop" /* 19 */;
2026-07-29 08:29:29 +00:00
2026-08-24 06:08:38 +00:00
const useRef = noop.useRef;
const Animated = get_ActivityIndicator.Animated;
2026-07-29 08:29:29 +00:00
export function useEventHandlerRegistration(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
return (workletEventHandler) => {
if (workletEventHandler.current) {
2026-08-24 06:08:38 +00:00
let findNodeHandleResult = ref(closure_1_1[2]).findNodeHandle(tmp.current);
2026-07-29 08:29:29 +00:00
if (findNodeHandleResult) {
if ("workletEventHandler" in workletEventHandler) {
workletEventHandler.workletEventHandler.registerForEvents(findNodeHandleResult);
workletEventHandler = workletEventHandler.workletEventHandler;
} else {
workletEventHandler.registerForEvents(findNodeHandleResult);
}
}
2026-08-24 06:08:38 +00:00
const obj = ref(closure_1_1[2]);
2026-07-29 08:29:29 +00:00
} else {
const _queueMicrotask = queueMicrotask;
queueMicrotask(function attachWorkletHandlers() {
2026-08-24 06:08:38 +00:00
const findNodeHandleResult = workletEventHandler(closure_2_1[2]).findNodeHandle(workletEventHandler.current);
2026-07-29 08:29:29 +00:00
if (findNodeHandleResult) {
if ("workletEventHandler" in workletEventHandler) {
obj2.workletEventHandler.registerForEvents(findNodeHandleResult);
} else {
obj2.registerForEvents(findNodeHandleResult);
}
}
});
}
return () => {
2026-08-24 06:08:38 +00:00
const findNodeHandleResult = workletEventHandler(closure_2_1[2]).findNodeHandle(workletEventHandler.current);
2026-07-29 08:29:29 +00:00
if (findNodeHandleResult) {
if ("workletEventHandler" in workletEventHandler) {
obj2.workletEventHandler.unregisterFromEvents(findNodeHandleResult);
} else {
obj2.unregisterFromEvents(findNodeHandleResult);
}
}
};
};
}
export const useAnimatedValue = function useAnimatedValue(arg0, arg1) {
const tmp = useRef(null);
if (null === tmp.current) {
const value = new Animated.Value(arg0, arg1);
tmp.current = value;
}
return tmp.current;
};