MCPcopy
hub / github.com/fabiospampinato/cash / addEvent

Function addEvent

src/events/helpers/add_event.ts:5–14  ·  view source on GitHub ↗
( ele: EleLoose, name: string, namespaces: string[], selector: string, callback: EventCallback )

Source from the content-addressed store, hash-verified

3// @require events/helpers/get_events_cache.ts
4
5function addEvent ( ele: EleLoose, name: string, namespaces: string[], selector: string, callback: EventCallback ): void {
6
7 const eventCache = getEventsCache ( ele );
8
9 eventCache[name] = ( eventCache[name] || [] );
10 eventCache[name].push ([ namespaces, selector, callback ]);
11
12 ele.addEventListener ( name, callback );
13
14}

Callers 1

onFunction · 0.85

Calls 1

getEventsCacheFunction · 0.85

Tested by

no test coverage detected