EventEmitter class
The representation of event emitter.
Constructors
Section titled “Constructors”constructor
Section titled “constructor”The default constructor.
⊕ new EventEmitter(source: any): EventEmitter
Parameters:
Section titled “Parameters:”- source:
any- The source.
Protected Properties
Section titled “Protected Properties”events
Section titled “events”The array of events.
● events: EqEventTypeRec[]
source
Section titled “source”The source.
● source: any
Public Methods
Section titled “Public Methods”enterSilentMode
Section titled “enterSilentMode”Enters to silent mode.
▸ enterSilentMode(): void
Returns void
exitSilentMode
Section titled “exitSilentMode”Exits from silent mode.
▸ exitSilentMode(): void
Returns void
Fires the event.
▸ fire(eventType: string,data?: any,postpone?: number,force?: boolean): void
Parameters:
Section titled “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 istrue, ignores silent mode.
Returns void
isSilent
Section titled “isSilent”Checks if emitter is in silent mode.
▸ isSilent(): boolean
Returns boolean - true, if silent mode is enable.
subscribe
Section titled “subscribe”Subscries to the event.
▸ subscribe(eventType: string,callback: (event: EqEvent) => void): string
Parameters:
Section titled “Parameters:”- eventType:
string- The event type. - callback: (event: EqEvent) =>
void- The callback.
Returns string - The subscribtion ID.
unsubscribe
Section titled “unsubscribe”Unsubsribes from the event.
▸ unsubscribe(eventType: string,callbackId: string): void
Parameters:
Section titled “Parameters:”- eventType:
string- The event type. - callbackId:
string- The subscribtion ID.
Returns void