Skip to content
Functioncorev0.10.0Decorator

Subscribe

Registers a subscriber handler class with a specific subscriber event.

Associates the decorated class with a subscriber event type for automatic registration and execution when the subscriber is emitted.

Subscribe<TSubscriber>(
    subscriber: TSubscriber,
    options?: SubscribeOptions
): <
    HandlerCtor extends Constructor<
        Subscriber<TSubscriber, CoreBase>
    >
>(
    constructor: HandlerCtor
) => void

TSubscriber

The subscriber event name to register for

TSubscriber

The subscriber event name to register for

subscriber

subscriber: TSubscriber

The subscriber event name to register for

options?

Options to configure the subscriber handler registration.