decord/source/__polyfill/01xxx/module_1783.js
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

31 lines
938 B
JavaScript

// Module ID: 1783
// Function ID: 1784
// Dependencies: [19, 1741]
// Exports: useEvent
// Module 1783
import _mod19 from "module_19" /* 19 */;
import WorkletEventHandlerNative from "WorkletEventHandlerNative" /* 1741 */;
const useRef = _mod19.useRef;
export const useEvent = function useEvent(fn, items, doDependenciesDiffer) {
if (items === undefined) {
items = [];
}
let flag = doDependenciesDiffer;
if (doDependenciesDiffer === undefined) {
flag = false;
}
const tmp = useRef(null);
if (null === tmp.current) {
const workletEventHandler1 = new WorkletEventHandlerNative.WorkletEventHandler(fn, items);
const obj2 = { workletEventHandler: workletEventHandler1 };
tmp.current = obj2;
} else if (flag) {
tmp.current.workletEventHandler.updateEventHandler(fn, items);
const obj = { workletEventHandler: tmp.current.workletEventHandler };
tmp.current = obj;
}
return tmp.current;
};