Skip to content

flow

@pencroff-lab/kore / flow

Result tuples as free functions — the tuple tier of the package.

flow operates directly on ResultTuple<T>: [value, null] on success, [null, Err] on failure. There is no container to construct or unwrap, so a result destructures at any point and every operation is a plain function.

Key concepts:

  • One fallible protocol — every fallible callback returns a ResultTuple. The error slot is the only failure signal; no operator inspects a value’s runtime shape. Maps and value adapters always carry callback returns as data.
  • ok / fail are the boundary — ok(err) and ok(tuple) carry error- or tuple-shaped values as successful data.
  • Exception boundaries — attempt/attemptAsync, every callback-taking operation, and every pipeline stage convert a throw into Err.from(caught). attemptValue / attemptValueAsync always envelope throwing value returns, normalizing untyped data to unknown for validation by the caller.
  • Type guards reject inferred raw any returns and sources. Explicit type arguments, preannotations and casts erase that check; use unsafe-any lint.
  • Input protection — a pipeline copies its source once on entry, and tuple callbacks receive a copy. Payloads are never cloned.
  • Error enrichment lives on Err: use mapErr/onErr and chain wrap, withCode, withMetadata inside the callback.

See

flow.examples.test.ts for usage patterns

Type Aliases

AnyOp

AnyOp<In, Out, Raw> = (tuple) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Defined in: flow/flow.types.ts:66

Stage accepted by pipeAsync: it may settle synchronously or not.

A single call signature with a union return, not a union of Op and OpAsync — TypeScript cannot instantiate a generic stage (the one onErr returns) against a union target, which would collapse the pipeline’s success type to unknown. Every Op and OpAsync is assignable here. It does not make an async stage valid in the synchronous pipe.

Type Parameters

In

In

Out

Out

Raw

Raw extends AsyncSource <Out> = AsyncSource <Out>


AsyncSource

AsyncSource<T, Raw> = Raw & NoAny<Raw>

Defined in: flow/flow.types.ts:72

Source accepted by pipeAsync: a tuple, or a promise of one.

Type Parameters

T

T

Raw

Raw extends ResultTuple <T> | Promise<ResultTuple <T>> = ResultTuple <T> | Promise<ResultTuple <T>>


OkValue

OkValue<R> = R extends readonly [infer V, null] ? V : never

Defined in: flow/flow.types.ts:82

Success type carried by a result tuple.

Type Parameters

R

R


OkValues

OkValues<T> = { -readonly [K in keyof T]: OkValue<T[K]> }

Defined in: flow/flow.types.ts:88

Success types of a collection of result tuples, positionally. A tuple of results maps to a tuple of values; an array maps to an array.

Type Parameters

T

T extends readonly unknown[]


Op

Op<In, Out, Raw> = (tuple) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Defined in: flow/flow.types.ts:39

Synchronous pipeline stage: tuple in, tuple out.

Type Parameters

In

In

Input success type

Out

Out

Output success type

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>


OpAsync

OpAsync<In, Out, Raw> = (tuple) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Defined in: flow/flow.types.ts:50

Asynchronous pipeline stage.

Type Parameters

In

In

Input success type

Out

Out

Output success type

Raw

Raw extends Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>


ResultTuple

ResultTuple<T> = readonly [T, null] | readonly [null, Err ]

Defined in: types/common.types.ts:15

Tuple-based result with positional semantics, shared by the flow and Outcome tiers.

  • [T, null]: success with value
  • [null, Err]: failure

The error slot is the discriminant — ok(null) is the valid success tuple [null, null]. Readonly at the type level; nested payloads are not protected.

Type Parameters

T

T

Functions

all()

all<T>(results): ResultTuple <OkValues <T>>

Defined in: flow/flow.ts:1111

Combine already-evaluated results, succeeding only if every one succeeded.

Order-preserving and non-short-circuiting: every failure is collected into one aggregate Err. Heterogeneous input infers a tuple of success types. Empty input succeeds with [].

Type Parameters

T

T extends readonly ResultTuple <unknown>[]

Parameters

results

T

Result tuples to combine

Returns

ResultTuple <OkValues <T>>

Success with all values, or one aggregate failure


any()

any<T>(results): ResultTuple <T>

Defined in: flow/flow.ts:1140

Return the first successful result, by reference.

The winning tuple is the caller’s own, not a copy. If every input failed the errors are aggregated; empty input fails with code EMPTY_INPUT.

Type Parameters

T

T

Parameters

results

readonly ResultTuple <T>[]

Result tuples to check

Returns

ResultTuple <T>

The first success, or an aggregate failure


attempt()

attempt<T, Raw>(fn): ResultTuple <OkValue <Raw>>

Defined in: flow/flow.ts:120

Run a fallible callback, converting a throw into a failure tuple.

Type Parameters

T

T

Raw

Raw extends ResultTuple <T> = ResultTuple <T>

Parameters

fn

() => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback returning a result tuple

Returns

ResultTuple <OkValue <Raw>>

The callback’s tuple, or Err.from(caught) as a failure


attemptAsync()

attemptAsync<T, Raw>(fn): Promise<ResultTuple <OkValue <Awaited<Raw>>>>

Defined in: flow/flow.ts:136

Async counterpart of attempt(). Converts throws and rejections.

Type Parameters

T

T

Raw

Raw extends ResultTuple <T> | Promise<ResultTuple <T>> = Promise<ResultTuple <T>>

Parameters

fn

() => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback returning a result tuple

Returns

Promise<ResultTuple <OkValue <Awaited<Raw>>>>

Promise of the callback’s tuple, or of a failure


attemptValue()

attemptValue<T>(fn): ResultTuple <SafeValue<T>>

Defined in: flow/flow.ts:157

Wrap a throwing value callback as data, normalizing any to unknown.

Type Parameters

T

T

Parameters

fn

() => T & SyncValue<T>

Synchronous data callback; use attemptValueAsync for PromiseLike returns

Returns

ResultTuple <SafeValue<T>>

A success envelope, or a caught throw as a failure

See

flow.examples.test.ts


attemptValueAsync()

attemptValueAsync<T>(fn): Promise<ResultTuple <SafeValue<Awaited<T>>>>

Defined in: flow/flow.ts:173

Await and wrap a value callback, converting throws and rejections.

Type Parameters

T

T

Parameters

fn

() => PromiseLike<T>

Callback returning a promise of data

Returns

Promise<ResultTuple <SafeValue<Awaited<T>>>>

A success envelope with awaited any normalized to unknown, or a failure


copy()

copy<T>(tuple): T

Defined in: flow/flow.ts:68

Copy a result tuple, keeping its narrowed type.

Two slots only — the payload is shared, not cloned.

Type Parameters

T

T extends ResultTuple <unknown>

Parameters

tuple

T

Tuple to copy

Returns

T

A new tuple with the same slots


defaultTo()

defaultTo<T>(tuple, onErr): T

Defined in: flow/flow.ts:1072

Extract the success value, or compute a fallback from the error.

Handler-only: a constant fallback is defaultTo(tuple, () => 0). The handler is lazy and its exceptions propagate — this operation adds no catch boundary.

Type Parameters

T

T

Parameters

tuple

ResultTuple <T>

Source result

onErr

(error) => T

Handler called only on the failure branch

Returns

T

The success value, or the handler’s result


effect()

effect<T>(tuple, fn): ResultTuple <T>

Defined in: flow/flow.ts:342

Run a side effect on either channel.

The callback receives the returned copy, not the caller’s tuple, and its callback must return void or undefined. A throw becomes the failure.

Type Parameters

T

T

Parameters

tuple

ResultTuple <T>

Source result

fn

(tuple) => void | undefined

Side effect receiving the output tuple

Returns

ResultTuple <T>

The output copy, or a caught throw as a failure


effectAsync()

effectAsync<T>(tuple, fn): Promise<ResultTuple <T>>

Defined in: flow/flow.ts:363

Async counterpart of effect().

Type Parameters

T

T

Parameters

tuple

ResultTuple <T>

Source result

fn

(tuple) => Promise<void>

Async side effect receiving the output tuple

Returns

Promise<ResultTuple <T>>

Promise of the output copy, or of a failure


either()

either<T, U>(tuple, onOk, onErr): U

Defined in: flow/flow.ts:1088

Fold both channels to a common output type. Handler exceptions propagate.

Type Parameters

T

T

U

U

Parameters

tuple

ResultTuple <T>

Source result

onOk

(value) => U

Handler for the success value

onErr

(error) => U

Handler for the error

Returns

U

The selected handler’s result


ensure()

ensure<T, S, Predicate, ErrorValue>(tuple, predicate, toErr): ResultTuple <S>

Defined in: flow/flow.ts:388

Validate a success value, optionally refining its type.

A passing predicate returns the original success tuple untouched; a failing one builds the error lazily. A throw from either callback becomes the failure. A failure input passes through and calls neither callback.

Type Parameters

T

T

S

S = T

Predicate

Predicate extends boolean = boolean

ErrorValue

ErrorValue extends Err = Err

Parameters

tuple

ResultTuple <T>

Source result

predicate

Type predicate or boolean test

(value) => value is S | (value) => Predicate & NoAny<Predicate>

toErr

(value) => ErrorValue & NoAny<ErrorValue, unknown, UseAttemptValueOrAttemptValueAsync>

Error factory, called only when the predicate fails

Returns

ResultTuple <S>

The original success, a constructed failure, or a caught throw


fail()

fail(error, code?): ResultTuple <never>

Defined in: flow/flow.ts:107

Create a failure tuple.

An existing Err is preserved by reference unless a code is supplied, in which case it is cloned with that code. Richer construction — metadata, a wrapped native error, a serialized payload — goes through Err.from(...) and is then passed here as fail(err).

Parameters

error

An existing Err, or a message to build one from

string | Err

code?

string

Optional error code

Returns

ResultTuple <never>

[null, Err]


flatMap()

flatMap<In, Out, Raw>(tuple, fn): ResultTuple <OkValue <Raw>>

Defined in: flow/flow.ts:239

Chain a fallible callback on the success channel.

The callback’s tuple is returned by reference, so a tuple-returning callee composes directly: flatMap(ok(project), readConfig). A failure passes through by reference.

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>

Parameters

tuple

ResultTuple <In>

Source result

fn

(value) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback returning a result tuple

Returns

ResultTuple <OkValue <Raw>>

The callback’s tuple, the original failure, or a caught throw


flatMapAsync()

flatMapAsync<In, Out, Raw>(tuple, fn): Promise<ResultTuple <OkValue <Awaited<Raw>>>>

Defined in: flow/flow.ts:263

Async counterpart of flatMap().

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> | Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>

Parameters

tuple

ResultTuple <In>

Source result

fn

(value) => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback returning a result tuple

Returns

Promise<ResultTuple <OkValue <Awaited<Raw>>>>

Promise of the resulting tuple


fromJSON()

fromJSON<T>(payload): ResultTuple <T>

Defined in: flow/flow.ts:1180

Reconstruct a result tuple from JSON.parse output.

Validation covers the envelope and the error slot only — T is a caller assertion, not a decode, and an error-shaped success payload is preserved unchanged. Never throws: every invalid input returns an INVALID_JSON failure carrying the payload as originalValue metadata. ok() serializes to [null, null] and reconstructs as ok(null); void does not round-trip.

Type Parameters

T

T

Parameters

payload

unknown

Parsed JSON value

Returns

ResultTuple <T>

The reconstructed tuple, or an INVALID_JSON failure


map()

map<In, Out>(tuple, fn): ResultTuple <Out>

Defined in: flow/flow.ts:197

Transform a success value with a total function.

Return-preserving: the callback’s return is the success value even when it is an Err, a native Error, or a tuple. A failure passes through by reference.

Type Parameters

In

In

Out

Out

Parameters

tuple

ResultTuple <In>

Source result

fn

(value) => Out

Transformation applied to the success value

Returns

ResultTuple <Out>

Transformed success, the original failure, or a caught throw


mapAsync()

mapAsync<In, Out>(tuple, fn): Promise<ResultTuple <Out>>

Defined in: flow/flow.ts:216

Async counterpart of map().

Type Parameters

In

In

Out

Out

Parameters

tuple

ResultTuple <In>

Source result

fn

(value) => Promise<Out>

Async transformation applied to the success value

Returns

Promise<ResultTuple <Out>>

Promise of the transformed result


mapErr()

mapErr<In, Out, Raw>(tuple, fn): ResultTuple <In | OkValue <Raw>>

Defined in: flow/flow.ts:291

Transform or recover from a failure.

fail(error.wrap(...)) replaces the error, ok(value) recovers, and ok(error) recovers with the error as data. A success passes through by reference.

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>

Parameters

tuple

ResultTuple <In>

Source result

fn

(error) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback receiving the error and returning a result tuple

Returns

ResultTuple <In | OkValue <Raw>>

The callback’s tuple, the original success, or a caught throw


mapErrAsync()

mapErrAsync<In, Out, Raw>(tuple, fn): Promise<ResultTuple <In | OkValue <Awaited<Raw>>>>

Defined in: flow/flow.ts:315

Async counterpart of mapErr().

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> | Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>

Parameters

tuple

ResultTuple <In>

Source result

fn

(error) => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback receiving the error

Returns

Promise<ResultTuple <In | OkValue <Awaited<Raw>>>>

Promise of the resulting tuple


ok()

Call Signature

ok(): ResultTuple <void>

Defined in: flow/flow.ts:77

Create a success tuple with no value.

Returns

ResultTuple <void>

[undefined, null]

Call Signature

ok<T>(value): ResultTuple <T>

Defined in: flow/flow.ts:88

Create a success tuple carrying a value.

The value is never inspected: ok(err) and ok(tuple) carry error- and tuple-shaped data as success.

Type Parameters
T

T

Parameters
value

T

The success value

Returns

ResultTuple <T>

[value, null]


onErr()

onErr<Out, Raw>(fn): <In>(tuple) => ResultTuple <In | OkValue <Raw>>

Defined in: flow/flow.ts:456

Stage running a callback on the error channel.

The stage — not this factory — is generic in the pipeline’s success type. An error callback offers no site from which In could be inferred, so a factory type parameter would collapse to unknown as soon as the stage is stored in a variable, widening the whole pipeline.

Type Parameters

Out

Out

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>

Parameters

fn

(error) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback receiving the error and returning a result tuple

Returns

A synchronous pipeline stage that preserves the success type

<In>(tuple): ResultTuple <In | OkValue <Raw>>

Type Parameters
In

In

Parameters
tuple

ResultTuple <In>

Returns

ResultTuple <In | OkValue <Raw>>


onErrAsync()

onErrAsync<Out, Raw>(fn): <In>(tuple) => Promise<ResultTuple <In | OkValue <Awaited<Raw>>>>

Defined in: flow/flow.ts:469

Async counterpart of onErr().

Type Parameters

Out

Out

Raw

Raw extends ResultTuple <Out> | Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>

Parameters

fn

(error) => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback receiving the error

Returns

An asynchronous pipeline stage that preserves the success type

<In>(tuple): Promise<ResultTuple <In | OkValue <Awaited<Raw>>>>

Type Parameters
In

In

Parameters
tuple

ResultTuple <In>

Returns

Promise<ResultTuple <In | OkValue <Awaited<Raw>>>>


onOk()

onOk<In, Out, Raw>(fn): (tuple) => ResultTuple

Defined in: flow/flow.ts:421

Stage running a fallible callback on the success value.

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>

Parameters

fn

(value) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback returning a result tuple

Returns

A synchronous pipeline stage

(tuple): ResultTuple

Parameters
tuple

ResultTuple <In>

Returns

ResultTuple


onOkAsync()

onOkAsync<In, Out, Raw>(fn): (tuple) => Promise

Defined in: flow/flow.ts:434

Async counterpart of onOk().

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> | Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>

Parameters

fn

(value) => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback returning a result tuple

Returns

An asynchronous pipeline stage

(tuple): Promise

Parameters
tuple

ResultTuple <In>

Returns

Promise


onTuple()

onTuple<In, Out, Raw>(fn): (tuple) => ResultTuple

Defined in: flow/flow.ts:487

Stage running a callback on a copy of the whole tuple, on either channel.

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> = ResultTuple <Out>

Parameters

fn

(tuple) => Raw & NoAny<Raw, unknown, UseAttemptValueOrAttemptValueAsync>

Callback receiving a tuple copy and returning a result tuple

Returns

A synchronous pipeline stage

(tuple): ResultTuple

Parameters
tuple

ResultTuple <In>

Returns

ResultTuple


onTupleAsync()

onTupleAsync<In, Out, Raw>(fn): (tuple) => Promise

Defined in: flow/flow.ts:505

Async counterpart of onTuple().

Type Parameters

In

In

Out

Out

Raw

Raw extends ResultTuple <Out> | Promise<ResultTuple <Out>> = Promise<ResultTuple <Out>>

Parameters

fn

(tuple) => Raw & NoAny<Raw, Promise<unknown>, UseAttemptValueOrAttemptValueAsync>

Async callback receiving a tuple copy

Returns

An asynchronous pipeline stage

(tuple): Promise

Parameters
tuple

ResultTuple <In>

Returns

Promise


pipe()

Call Signature

pipe<A, Source>(source): ResultTuple <OkValue <Source>>

Defined in: flow/flow.ts:532

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

Source

Source extends ResultTuple <A> = ResultTuple <A>

Parameters
source

Source & NoAny<Source>

Returns

ResultTuple <OkValue <Source>>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, Source, R1>(source, op1): ResultTuple <B>

Defined in: flow/flow.ts:536

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

Returns

ResultTuple <B>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, Source, R1, R2>(source, op1, op2): ResultTuple <C>

Defined in: flow/flow.ts:546

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

Returns

ResultTuple <C>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, Source, R1, R2, R3>(source, op1, op2, op3): ResultTuple <D>

Defined in: flow/flow.ts:559

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

Returns

ResultTuple <D>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, Source, R1, R2, R3, R4>(source, op1, op2, op3, op4): ResultTuple <E>

Defined in: flow/flow.ts:575

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

Returns

ResultTuple <E>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, Source, R1, R2, R3, R4, R5>(source, op1, op2, op3, op4, op5): ResultTuple <F>

Defined in: flow/flow.ts:594

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

Returns

ResultTuple <F>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, G, Source, R1, R2, R3, R4, R5, R6>(source, op1, op2, op3, op4, op5, op6): ResultTuple <G>

Defined in: flow/flow.ts:616

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

R6

R6 extends ResultTuple <G> = ResultTuple <G>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

op6

Op <NoInfer<F>, G, R6 & ResultSlots<G>>

Returns

ResultTuple <G>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, G, H, Source, R1, R2, R3, R4, R5, R6, R7>(source, op1, op2, op3, op4, op5, op6, op7): ResultTuple <H>

Defined in: flow/flow.ts:641

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

R6

R6 extends ResultTuple <G> = ResultTuple <G>

R7

R7 extends ResultTuple <H> = ResultTuple <H>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

op6

Op <NoInfer<F>, G, R6 & ResultSlots<G>>

op7

Op <NoInfer<G>, H, R7 & ResultSlots<H>>

Returns

ResultTuple <H>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, G, H, I, Source, R1, R2, R3, R4, R5, R6, R7, R8>(source, op1, op2, op3, op4, op5, op6, op7, op8): ResultTuple <I>

Defined in: flow/flow.ts:669

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

R6

R6 extends ResultTuple <G> = ResultTuple <G>

R7

R7 extends ResultTuple <H> = ResultTuple <H>

R8

R8 extends ResultTuple <I> = ResultTuple <I>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

op6

Op <NoInfer<F>, G, R6 & ResultSlots<G>>

op7

Op <NoInfer<G>, H, R7 & ResultSlots<H>>

op8

Op <NoInfer<H>, I, R8 & ResultSlots<I>>

Returns

ResultTuple <I>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, G, H, I, J, Source, R1, R2, R3, R4, R5, R6, R7, R8, R9>(source, op1, op2, op3, op4, op5, op6, op7, op8, op9): ResultTuple <J>

Defined in: flow/flow.ts:700

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

J

J

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

R6

R6 extends ResultTuple <G> = ResultTuple <G>

R7

R7 extends ResultTuple <H> = ResultTuple <H>

R8

R8 extends ResultTuple <I> = ResultTuple <I>

R9

R9 extends ResultTuple <J> = ResultTuple <J>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

op6

Op <NoInfer<F>, G, R6 & ResultSlots<G>>

op7

Op <NoInfer<G>, H, R7 & ResultSlots<H>>

op8

Op <NoInfer<H>, I, R8 & ResultSlots<I>>

op9

Op <NoInfer<I>, J, R9 & ResultSlots<J>>

Returns

ResultTuple <J>

See

pipeAsync for asynchronous and mixed stages

Call Signature

pipe<A, B, C, D, E, F, G, H, I, J, K, Source, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(source, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10): ResultTuple <K>

Defined in: flow/flow.ts:734

Run synchronous stages over a result tuple.

The source is copied once on entry, and each stage is caught separately so a later onErr stage can recover. Accepts up to ten typed stages; compose longer flows in typed chunks.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

J

J

K

K

Source

Source extends ResultTuple <A> = ResultTuple <A>

R1

R1 extends ResultTuple <B> = ResultTuple <B>

R2

R2 extends ResultTuple <C> = ResultTuple <C>

R3

R3 extends ResultTuple <D> = ResultTuple <D>

R4

R4 extends ResultTuple <E> = ResultTuple <E>

R5

R5 extends ResultTuple <F> = ResultTuple <F>

R6

R6 extends ResultTuple <G> = ResultTuple <G>

R7

R7 extends ResultTuple <H> = ResultTuple <H>

R8

R8 extends ResultTuple <I> = ResultTuple <I>

R9

R9 extends ResultTuple <J> = ResultTuple <J>

R10

R10 extends ResultTuple <K> = ResultTuple <K>

Parameters
source

Source & ResultSlots<A> & NoAny<Source>

op1

Op <NoInfer<A>, B, R1 & ResultSlots<B>>

op2

Op <NoInfer<B>, C, R2 & ResultSlots<C>>

op3

Op <NoInfer<C>, D, R3 & ResultSlots<D>>

op4

Op <NoInfer<D>, E, R4 & ResultSlots<E>>

op5

Op <NoInfer<E>, F, R5 & ResultSlots<F>>

op6

Op <NoInfer<F>, G, R6 & ResultSlots<G>>

op7

Op <NoInfer<G>, H, R7 & ResultSlots<H>>

op8

Op <NoInfer<H>, I, R8 & ResultSlots<I>>

op9

Op <NoInfer<I>, J, R9 & ResultSlots<J>>

op10

Op <NoInfer<J>, K, R10 & ResultSlots<K>>

Returns

ResultTuple <K>

See

pipeAsync for asynchronous and mixed stages


pipeAsync()

Call Signature

pipeAsync<A, Source>(source): Promise<ResultTuple <OkValue <Awaited<Source>>>>

Defined in: flow/flow.ts:797

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

Parameters
source

Source & NoAny<Source>

Returns

Promise<ResultTuple <OkValue <Awaited<Source>>>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, Source, R1>(source, op1): Promise<ResultTuple <B>>

Defined in: flow/flow.ts:801

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

Returns

Promise<ResultTuple <B>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, Source, R1, R2>(source, op1, op2): Promise<ResultTuple <C>>

Defined in: flow/flow.ts:811

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

Returns

Promise<ResultTuple <C>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, Source, R1, R2, R3>(source, op1, op2, op3): Promise<ResultTuple <D>>

Defined in: flow/flow.ts:824

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

Returns

Promise<ResultTuple <D>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, Source, R1, R2, R3, R4>(source, op1, op2, op3, op4): Promise<ResultTuple <E>>

Defined in: flow/flow.ts:840

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

Returns

Promise<ResultTuple <E>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, Source, R1, R2, R3, R4, R5>(source, op1, op2, op3, op4, op5): Promise<ResultTuple <F>>

Defined in: flow/flow.ts:859

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

Returns

Promise<ResultTuple <F>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, G, Source, R1, R2, R3, R4, R5, R6>(source, op1, op2, op3, op4, op5, op6): Promise<ResultTuple <G>>

Defined in: flow/flow.ts:881

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

R6

R6 extends ResultTuple <G> | Promise<ResultTuple <G>> = ResultTuple <G> | Promise<ResultTuple <G>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

op6

AnyOp <NoInfer<F>, G, R6 & AsyncSlots<G>>

Returns

Promise<ResultTuple <G>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, G, H, Source, R1, R2, R3, R4, R5, R6, R7>(source, op1, op2, op3, op4, op5, op6, op7): Promise<ResultTuple <H>>

Defined in: flow/flow.ts:906

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

R6

R6 extends ResultTuple <G> | Promise<ResultTuple <G>> = ResultTuple <G> | Promise<ResultTuple <G>>

R7

R7 extends ResultTuple <H> | Promise<ResultTuple <H>> = ResultTuple <H> | Promise<ResultTuple <H>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

op6

AnyOp <NoInfer<F>, G, R6 & AsyncSlots<G>>

op7

AnyOp <NoInfer<G>, H, R7 & AsyncSlots<H>>

Returns

Promise<ResultTuple <H>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, G, H, I, Source, R1, R2, R3, R4, R5, R6, R7, R8>(source, op1, op2, op3, op4, op5, op6, op7, op8): Promise<ResultTuple <I>>

Defined in: flow/flow.ts:934

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

R6

R6 extends ResultTuple <G> | Promise<ResultTuple <G>> = ResultTuple <G> | Promise<ResultTuple <G>>

R7

R7 extends ResultTuple <H> | Promise<ResultTuple <H>> = ResultTuple <H> | Promise<ResultTuple <H>>

R8

R8 extends ResultTuple <I> | Promise<ResultTuple <I>> = ResultTuple <I> | Promise<ResultTuple <I>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

op6

AnyOp <NoInfer<F>, G, R6 & AsyncSlots<G>>

op7

AnyOp <NoInfer<G>, H, R7 & AsyncSlots<H>>

op8

AnyOp <NoInfer<H>, I, R8 & AsyncSlots<I>>

Returns

Promise<ResultTuple <I>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, G, H, I, J, Source, R1, R2, R3, R4, R5, R6, R7, R8, R9>(source, op1, op2, op3, op4, op5, op6, op7, op8, op9): Promise<ResultTuple <J>>

Defined in: flow/flow.ts:965

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

J

J

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

R6

R6 extends ResultTuple <G> | Promise<ResultTuple <G>> = ResultTuple <G> | Promise<ResultTuple <G>>

R7

R7 extends ResultTuple <H> | Promise<ResultTuple <H>> = ResultTuple <H> | Promise<ResultTuple <H>>

R8

R8 extends ResultTuple <I> | Promise<ResultTuple <I>> = ResultTuple <I> | Promise<ResultTuple <I>>

R9

R9 extends ResultTuple <J> | Promise<ResultTuple <J>> = ResultTuple <J> | Promise<ResultTuple <J>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

op6

AnyOp <NoInfer<F>, G, R6 & AsyncSlots<G>>

op7

AnyOp <NoInfer<G>, H, R7 & AsyncSlots<H>>

op8

AnyOp <NoInfer<H>, I, R8 & AsyncSlots<I>>

op9

AnyOp <NoInfer<I>, J, R9 & AsyncSlots<J>>

Returns

Promise<ResultTuple <J>>

See

pipe for the synchronous version

Call Signature

pipeAsync<A, B, C, D, E, F, G, H, I, J, K, Source, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(source, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10): Promise<ResultTuple <K>>

Defined in: flow/flow.ts:999

Run synchronous and asynchronous stages over a result tuple or a promise of one.

A rejected source enters the failure channel before the first stage, so a later onErr stage can still recover. Typed through ten stages.

Type Parameters
A

A

B

B

C

C

D

D

E

E

F

F

G

G

H

H

I

I

J

J

K

K

Source

Source extends ResultTuple <A> | Promise<ResultTuple <A>> = ResultTuple <A> | Promise<ResultTuple <A>>

R1

R1 extends ResultTuple <B> | Promise<ResultTuple <B>> = ResultTuple <B> | Promise<ResultTuple <B>>

R2

R2 extends ResultTuple <C> | Promise<ResultTuple <C>> = ResultTuple <C> | Promise<ResultTuple <C>>

R3

R3 extends ResultTuple <D> | Promise<ResultTuple <D>> = ResultTuple <D> | Promise<ResultTuple <D>>

R4

R4 extends ResultTuple <E> | Promise<ResultTuple <E>> = ResultTuple <E> | Promise<ResultTuple <E>>

R5

R5 extends ResultTuple <F> | Promise<ResultTuple <F>> = ResultTuple <F> | Promise<ResultTuple <F>>

R6

R6 extends ResultTuple <G> | Promise<ResultTuple <G>> = ResultTuple <G> | Promise<ResultTuple <G>>

R7

R7 extends ResultTuple <H> | Promise<ResultTuple <H>> = ResultTuple <H> | Promise<ResultTuple <H>>

R8

R8 extends ResultTuple <I> | Promise<ResultTuple <I>> = ResultTuple <I> | Promise<ResultTuple <I>>

R9

R9 extends ResultTuple <J> | Promise<ResultTuple <J>> = ResultTuple <J> | Promise<ResultTuple <J>>

R10

R10 extends ResultTuple <K> | Promise<ResultTuple <K>> = ResultTuple <K> | Promise<ResultTuple <K>>

Parameters
source

Source & AsyncSlots<A> & NoAny<Source>

op1

AnyOp <NoInfer<A>, B, R1 & AsyncSlots<B>>

op2

AnyOp <NoInfer<B>, C, R2 & AsyncSlots<C>>

op3

AnyOp <NoInfer<C>, D, R3 & AsyncSlots<D>>

op4

AnyOp <NoInfer<D>, E, R4 & AsyncSlots<E>>

op5

AnyOp <NoInfer<E>, F, R5 & AsyncSlots<F>>

op6

AnyOp <NoInfer<F>, G, R6 & AsyncSlots<G>>

op7

AnyOp <NoInfer<G>, H, R7 & AsyncSlots<H>>

op8

AnyOp <NoInfer<H>, I, R8 & AsyncSlots<I>>

op9

AnyOp <NoInfer<I>, J, R9 & AsyncSlots<J>>

op10

AnyOp <NoInfer<J>, K, R10 & AsyncSlots<K>>

Returns

Promise<ResultTuple <K>>

See

pipe for the synchronous version