Skip to content

TypeScript API / contentia/core / ContentiaStream / runPromiseResult

Function: runPromiseResult() ​

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

Promise-shaped entry point that captures fatal failures as a ContentiaResult instead of rejecting.

Type Parameters ​

Type Parameter
A
D extends ContentiaDone

Parameters ​

ParameterType
selfContentiaStream<A, D>

Returns ​

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