InterfaceIEventOptions<T>

Constructor options for SubEvent class.

interface IEventOptions<T> {
    maxSubs?: number;
    onCancel?: ((ctx: ISubContext<T>) => void);
    onSubscribe?: ((ctx: ISubContext<T>) => void);
}

Type Parameters

  • T

Hierarchy (view full)

Properties

maxSubs?: number

Maximum number of subscribers that can receive events. Default is 0, meaning no limit applies.

Newer subscriptions outside the maximum quota will start receiving events when the older subscriptions get cancelled.

onCancel?: ((ctx: ISubContext<T>) => void)

Notification about a cancelled subscription.

(ctx: ISubContext<T>) => void;

Type declaration

onSubscribe?: ((ctx: ISubContext<T>) => void)

Notification of a new subscriber being registered.

(ctx: ISubContext<T>) => void;

Type declaration