class Bus extends TypedEventEmitter<SubscriptionTuples>Member visibility
Filter class members by access level.
Bus(core: CoreBase)Showing members with Protected visibility and higher.
Properties
Methods
protected core: CoreBasePublishes an event to its subscribers and native listeners.
Fire-and-forget. Subscriber handlers run asynchronously and this returns before they finish. A caller cannot assume a side effect has completed. Errors thrown by a subscriber or by an on() listener are caught and logged, never surfaced here. One throwing listener does not stop the others. Subscribers on one key run concurrently and carry no ordering guarantee. A 'once' subscriber is marked as executed when it starts, even if it throws. It never runs twice.
The framework's own keys are excluded. Subscribe to those and listen with on. The framework is their only publisher.
public publish<KeyOfSubscribers>(
event: KeyOfSubscribers,
data: AllSubscriptions[KeyOfSubscribers]
): booleaneventThe subscription key to publish
dataPayload passed to each subscriber