InterfaceIEmitOptions

Options to be used with method SubEvent.emit.

interface IEmitOptions {
    onError?: ((err: any, name?: string) => void);
    onFinished?: ((count: number) => void);
    schedule?: EmitSchedule;
}

Properties

onError?: ((err: any, name?: string) => void)

Callback for catching all unhandled errors from subscribers, from both synchronous and asynchronous subscription functions.

(err: any, name?: string) => void;

Type declaration

    • (err, name?): void
    • Parameters

      • err: any

        err: The error that was thrown or rejected.

      • Optionalname: string

        name: The subscription name, if set during SubEvent.subscribe call.

      Returns void

onFinished?: ((count: number) => void)

Notification callback of when the last recipient has received the data. Note that asynchronous subscribers may still be processing the data at this point.

(count: number) => void;

Type declaration

    • (count): void
    • Parameters

      • count: number

        count: Total number of subscribers that have received the data.

      Returns void

schedule?: EmitSchedule

Event-emitting schedule. Default is sync.