Interface MockSource<T>

An Emitter with a ready() method, that only supports a single active subscriber. (Useful for testing stream operators and sinks.)

Created using mockSource().

interface MockSource<T> {
    end: (() => void);
    ready: Backpressure;
    source: Source<T>;
    throw: ((e: any) => void);
    (val: T): void;
}

Type Parameters

  • T

Hierarchy (view full)

  • Call the emitter to emit events on its .source

    Parameters

    • val: T

    Returns void

Properties

Properties

end: (() => void)

Close all current subscribers' connections

Type declaration

    • (): void
    • Returns void

source: Source<T>

An event source that receives the events

throw: ((e: any) => void)

Close all current subscribers' connections with an error

Type declaration

    • (e: any): void
    • Parameters

      • e: any

      Returns void