Skip to content

TypeScript API / contentia/core / ContentiaStream / drainWithDone

Function: drainWithDone() ​

ts
function drainWithDone<A, D, R>(self, onChunk): Effect<D, ContentiaError<ErrorCode, number>, R>;

Drain a ContentiaStream, invoking onChunk for every chunk, and return the typed done value the stream terminates with.

Type Parameters ​

Type Parameter
A
D extends ContentiaDone
R

Parameters ​

ParameterType
selfContentiaStream<A, D, R>
onChunk(chunk) => Effect<void>

Returns ​

Effect<D, ContentiaError<ErrorCode, number>, R>