Interface ISubscriber<T>

interface ISubscriber<T> {
    __owner?: ISubscription<any, any>;
    done?: Fn0<void>;
    error?: ErrorHandler;
    next: Fn<T, void>;
    [id: string]: any;
}

Type Parameters

  • T

Hierarchy (view full)

Indexable

[id: string]: any

Properties

__owner?: ISubscription<any, any>

Internal use only. Do not use.

done?: Fn0<void>

Life cycle handler, usually invoked automatically when a finite stream source is finished.

Remarks

If the wrapping subscription has an associated transducer, any potentially internally buffered values will still be delivered to .next() first and the .done() handler only executed after.

.done() handlers are called depth-first (in terms of dataflow/subscription topology) and the wrapping subscription instance usually then triggers a teardown in reverse (topological) order, by calling ISubscribable.unsubscribe on itself.

If an error occurs during the execution of this handler, the subscription will still be potentially placed into the ERROR state, depending on presence and outcome of an error handler.

error?: ErrorHandler

Error handler, which will be called to handle any uncaught errors while executing ISubscriber.next or a transducer function attached to the Subscription wrapping this subscriber. The error handler must return true to indicate the error could be successfully handled/recovered from. If false, the subscription will go into State.ERROR and stops processing any further values (plus might trigger recursive teardown of the upstream dataflow topology).

next: Fn<T, void>

Receives new input value x and executes any side effect.

Generated using TypeDoc