EventEmitter class

The representation of event emitter.

Index

Constructors

Protected Properties

Public Methods

Constructors


constructor

The default constructor. ⊕ new EventEmitter(source: any): EventEmitter

Parameters:

  • source: any - The source.

Protected Properties


events

The array of events.

● events: EqEventTypeRec[]


source

The source.

● source: any


Public Methods


enterSilentMode

Enters to silent mode.

▸ enterSilentMode(): void

Returns void


exitSilentMode

Exits from silent mode.

▸ exitSilentMode(): void

Returns void


fire

Fires the event.

▸ fire(eventType: string,data?: any,postpone?: number,force?: boolean): void

Parameters:

  • eventType: string - The event type.
  • data: any, Optional - The event data.
  • postpone: number, Default value = 0 - The postpone.
  • force: boolean, Default value = false - To fire force. If value is true, ignores silent mode.

Returns void


isSilent

Checks if emitter is in silent mode.

▸ isSilent(): boolean

Returns boolean - true, if silent mode is enable.


subscribe

Subscries to the event.

▸ subscribe(eventType: string,callback: (event: EqEvent) => void): string

Parameters:

  • eventType: string - The event type.
  • callback: (event: EqEvent) => void - The callback.

Returns string - The subscribtion ID.


unsubscribe

Unsubsribes from the event.

▸ unsubscribe(eventType: string,callbackId: string): void

Parameters:

  • eventType: string - The event type.
  • callbackId: string - The subscribtion ID.

Returns void