MCPcopy Index your code
hub / github.com/UI5/webcomponents / attachEvent

Method attachEvent

packages/base/src/EventProvider.ts:8–20  ·  view source on GitHub ↗
(eventName: string, fnFunction: (param: EventListenerParam) => EventListenerReturn)

Source from the content-addressed store, hash-verified

6 }
7
8 attachEvent(eventName: string, fnFunction: (param: EventListenerParam) => EventListenerReturn) {
9 const eventRegistry = this._eventRegistry;
10 const eventListeners = eventRegistry.get(eventName);
11
12 if (!Array.isArray(eventListeners)) {
13 eventRegistry.set(eventName, [fnFunction]);
14 return;
15 }
16
17 if (!eventListeners.includes(fnFunction)) {
18 eventListeners.push(fnFunction);
19 }
20 }
21
22 detachEvent(eventName: string, fnFunction: (param: EventListenerParam) => EventListenerReturn) {
23 const eventRegistry = this._eventRegistry;

Callers 14

constructorMethod · 0.80
attachInvalidateFunction · 0.80
attachBootFunction · 0.80
attachDirectionChangeFunction · 0.80
attachLanguageChangeFunction · 0.80
attachCustomCSSChangeFunction · 0.80
attachThemeLoadedFunction · 0.80
attachThemeRegisteredFunction · 0.80
attachConfigChangeFunction · 0.80
attachConfigurationResetFunction · 0.80

Calls 2

getMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected