MCPcopy Create free account
hub / github.com/UI5/webcomponents / fireEvent

Method fireEvent

packages/base/src/EventProvider.ts:47–58  ·  view source on GitHub ↗

* Fires an event and returns the results of all event listeners as an array. * * @param eventName the event to fire * @param data optional data to pass to each event listener * @returns {Array} an array with the results of all event listeners

(eventName: string, data: EventListenerParam)

Source from the content-addressed store, hash-verified

45 * @returns {Array} an array with the results of all event listeners
46 */
47 fireEvent(eventName: string, data: EventListenerParam) {
48 const eventRegistry = this._eventRegistry;
49 const eventListeners = eventRegistry.get(eventName);
50
51 if (!eventListeners) {
52 return [];
53 }
54
55 return eventListeners.map(fn => {
56 return fn.call(this, data);
57 });
58 }
59
60 /**
61 * Fires an event and returns a promise that will resolve once all listeners have resolved.

Callers 15

fireEventAsyncMethod · 0.95
renderImmediatelyFunction · 0.80
_invalidateFunction · 0.80
_renderFunction · 0.80
bootExecutorFunction · 0.80
fireDirectionChangeFunction · 0.80
ontouchmoveMethod · 0.80
ontouchendMethod · 0.80
fireCustomCSSChangeFunction · 0.80
fireThemeLoadedFunction · 0.80
fireThemeRegisteredFunction · 0.80
fireConfigChangeFunction · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected