Skip to content

TypeScript API / contentia/core / ContentiaStream / runCollect

Function: runCollect() ​

ts
function runCollect<A, D, R>(self): Effect<{
  data: readonly A[];
  done: D;
  progress: readonly ContentiaProgress[];
  recoverableErrors: readonly ContentiaError<ErrorCode, number>[];
}, ContentiaError<ErrorCode, number>, R>;

Collect a ContentiaStream into its three buckets plus the done value.

When the caller is itself the body of a ContentiaStream.make or ContentiaTask.make (i.e. it's forwarding through a delegation chain), prefer runCollectForwarding — it pipes the inner stream's warnings into the outer emit instead of leaving the caller to manually re-emit them.

Type Parameters ​

Type Parameter
A
D extends ContentiaDone
R

Parameters ​

ParameterType
selfContentiaStream<A, D, R>

Returns ​

Effect<{ data: readonly A[]; done: D; progress: readonly ContentiaProgress[]; recoverableErrors: readonly ContentiaError<ErrorCode, number>[]; }, ContentiaError<ErrorCode, number>, R>