Skip to content

collectingSink

function collectingSink<T>(options?): CollectingSink<T>;

Defined in: src/testing/index.ts:81

Create a CollectingSink.

Type Parameter
T
Parameter Type
options? CollectingSinkOptions

CollectingSink<T>

const sink = collectingSink<AuditEvent>();
const stream = { kind: "collecting", send: (batch) => sink.push(...batch.events) };
sink.failNext(2); // the next two sends reject