Skip to content

TypeScript API / contentia/core / ContentiaTask / runCollect

Function: runCollect() ​

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

Drain a ContentiaTask collecting all recoverable errors and progress events, and return the resolved value.

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

Type Parameters ​

Type Parameter
A
R

Parameters ​

ParameterType
selfContentiaTask<A, R>

Returns ​

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