MCPcopy
hub / github.com/Splidejs/splide / forEachEvent

Function forEachEvent

src/js/constructors/EventBinder/EventBinder.ts:124–137  ·  view source on GitHub ↗

* Iterates over each target and event. * * @param targets - A target element, the window object or the document object. * @param events - An event name or names. * @param iteratee - An iteratee function.

(
    targets: EventTargets,
    events: string | string[],
    iteratee: ( target: EventTarget, event: string, namespace: string | undefined ) => void
  )

Source from the content-addressed store, hash-verified

122 * @param iteratee - An iteratee function.
123 */
124 function forEachEvent(
125 targets: EventTargets,
126 events: string | string[],
127 iteratee: ( target: EventTarget, event: string, namespace: string | undefined ) => void
128 ): void {
129 forEach( targets, target => {
130 target && forEach( events, events => {
131 events.split( ' ' ).forEach( eventNS => {
132 const fragment = eventNS.split( '.' );
133 iteratee( target, fragment[ 0 ], fragment[ 1 ] );
134 } );
135 } );
136 } );
137 }
138
139 /**
140 * Removes all listeners.

Callers 2

bindFunction · 0.85
unbindFunction · 0.85

Calls 2

forEachFunction · 0.90
forEachMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…