Skip to content

TypeScript API / laikacms/core / LaikaStream / runCollect

Function: runCollect() ​

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

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

When the caller is itself the body of a LaikaStream.make or LaikaTask.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 LaikaDone
R

Parameters ​

ParameterType
selfLaikaStream<A, D, R>

Returns ​

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

Released under the MIT License.