Function
addEvent
( 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 | |
| 5 | function 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 | } |
Tested by
no test coverage detected