InterfaceICountOptions<T>

Constructor options for SubEventCount class.

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

Type Parameters

  • T

Hierarchy (view full)

Properties

emitOptions?: IEmitOptions

Emit options for event SubEventCount.onCount.

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