Version: 4.3

Class: EventManager

Hierarchy

  • EventManager

Constructors

constructor

+ new EventManager(subscribers: EventSubscriber[]): EventManager

Defined in packages/core/src/events/EventManager.ts:9

Parameters:

NameType
subscribersEventSubscriber[]

Returns: EventManager

Properties

entities

Private Readonly entities: Map<EventSubscriber, string[]> = new Map()

Defined in packages/core/src/events/EventManager.ts:9


listeners

Private Readonly listeners: Partial<Record<EventType, EventSubscriber[]>>

Defined in packages/core/src/events/EventManager.ts:8

Methods

dispatchEvent

dispatchEvent<T>(event: onInit, args: Partial<EventArgs<T>>): unknown

Defined in packages/core/src/events/EventManager.ts:25

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
eventonInit
argsPartial<EventArgs<T>>

Returns: unknown

dispatchEvent<T>(event: EventType, args: Partial<EventArgs<T> | FlushEventArgs>): Promise<unknown>

Defined in packages/core/src/events/EventManager.ts:26

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
eventEventType
argsPartial<EventArgs<T> | FlushEventArgs>

Returns: Promise<unknown>


getSubscribedEntities

PrivategetSubscribedEntities(listener: EventSubscriber): string[]

Defined in packages/core/src/events/EventManager.ts:69

Parameters:

NameType
listenerEventSubscriber

Returns: string[]


hasListeners

hasListeners<T>(event: EventType, meta: EntityMetadata<T>): boolean

Defined in packages/core/src/events/EventManager.ts:50

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
eventEventType
metaEntityMetadata<T>

Returns: boolean


registerSubscriber

registerSubscriber(subscriber: EventSubscriber): void

Defined in packages/core/src/events/EventManager.ts:15

Parameters:

NameType
subscriberEventSubscriber

Returns: void

Last updated on by Martin Adámek