MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / patchEvent

Function patchEvent

web/main.js:7200–7218  ·  view source on GitHub ↗
(el, rawName, prevValue, nextValue, instance = null)

Source from the content-addressed store, hash-verified

7198}
7199const veiKey = /* @__PURE__ */ Symbol("_vei");
7200function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
7201 const invokers = el[veiKey] || (el[veiKey] = {});
7202 const existingInvoker = invokers[rawName];
7203 if (nextValue && existingInvoker) {
7204 existingInvoker.value = nextValue;
7205 } else {
7206 const [name, options] = parseName(rawName);
7207 if (nextValue) {
7208 const invoker = invokers[rawName] = createInvoker(
7209 nextValue,
7210 instance
7211 );
7212 addEventListener(el, name, invoker, options);
7213 } else if (existingInvoker) {
7214 removeEventListener(el, name, existingInvoker, options);
7215 invokers[rawName] = void 0;
7216 }
7217 }
7218}
7219const optionsModifierRE = /(?:Once|Passive|Capture)$/;
7220function parseName(name) {
7221 let options;

Callers 1

patchPropFunction · 0.85

Calls 4

parseNameFunction · 0.85
createInvokerFunction · 0.85
addEventListenerFunction · 0.85
removeEventListenerFunction · 0.85

Tested by

no test coverage detected