Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
31 lines
938 B
JavaScript
31 lines
938 B
JavaScript
// Module ID: 1784
|
|
// Function ID: 1785
|
|
// Dependencies: [19, 1742]
|
|
// Exports: useEvent
|
|
|
|
// Module 1784
|
|
import _mod19 from "module_19" /* 19 */;
|
|
import WorkletEventHandlerNative from "WorkletEventHandlerNative" /* 1742 */;
|
|
|
|
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;
|
|
};
|