Skip to content

TypeScript API / laikacms/core / LaikaTask / runCollect

Function: runCollect() ​

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

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

When the caller is itself the body of a LaikaTask.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
selfLaikaTask<A, R>

Returns ​

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

Released under the MIT License.