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

Function on

src/js/constructors/EventInterface/EventInterface.ts:52–56  ·  view source on GitHub ↗

* Listens to an internal event or events. * * @param events - An event name or names separated by spaces. Use a dot(.) to add a namespace. * @param callback - A callback function to register.

( events: string | string[], callback: AnyFunction )

Source from the content-addressed store, hash-verified

50 * @param callback - A callback function to register.
51 */
52 function on( events: string | string[], callback: AnyFunction ): void {
53 binder.bind( bus, toArray( events ).join( ' ' ), e => {
54 callback.apply( callback, isArray( e.detail ) ? e.detail : [] );
55 } );
56 }
57
58 /**
59 * Triggers callback functions.

Callers 15

mountFunction · 0.85
initFunction · 0.85
mountFunction · 0.85
listenFunction · 0.85
mountFunction · 0.85
mountFunction · 0.85
mountFunction · 0.85
mountFunction · 0.85
mountFunction · 0.85
listenFunction · 0.85
mountFunction · 0.85
mountFunction · 0.85

Calls 2

toArrayFunction · 0.90
bindMethod · 0.80

Tested by

no test coverage detected