MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / emitEvent

Method emitEvent

packages/core/xhr/index.ts:561–570  ·  view source on GitHub ↗
(eventName: string, ...args: Array<any>)

Source from the content-addressed store, hash-verified

559 }
560
561 private emitEvent(eventName: string, ...args: Array<any>) {
562 if (isFunction(this['on' + eventName])) {
563 this['on' + eventName](...args);
564 }
565
566 const handlers = this._listeners.get(eventName) || [];
567 handlers.forEach((handler) => {
568 handler(...args);
569 });
570 }
571
572 public addEventListener(eventName: string, handler: Function) {
573 if (['abort', 'error', 'load', 'loadend', 'loadstart', 'progress'].indexOf(eventName) === -1) {

Callers 1

_readMethod · 0.95

Calls 4

isFunctionFunction · 0.90
forEachMethod · 0.80
getMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected