Skip to content

Function: cascade()

Chains multiple coroutine tasks sequentially, creating a single CoroutineLike operator.

Each coroutine in the sequence processes the output of the previous coroutine, forming a data processing pipeline. This function is useful for composing complex asynchronous operations from simpler, reusable building blocks.

The final output type of the cascade is the output type of the last coroutine in the chain.

Template

The input type of the first coroutine.

Template

The output type of the last coroutine.

Param

An array of coroutines to chain.

Call Signature

cascade<A, B>(c1): CoroutineLike<A, B>

Defined in: operators/cascade.ts:35

Type Parameters

A

A

B

B

Parameters

c1

Coroutine<A, B>

Returns

CoroutineLike<A, B>

Call Signature

cascade<A, B, C>(c1, c2): CoroutineLike<A, C>

Defined in: operators/cascade.ts:37

Type Parameters

A

A

B

B

C

C

Parameters

c1

Coroutine<A, B>

c2

Coroutine<B, C>

Returns

CoroutineLike<A, C>

Call Signature

cascade<A, B, C, D>(c1, c2, c3): CoroutineLike<A, D>

Defined in: operators/cascade.ts:42

Type Parameters

A

A

B

B

C

C

D

D

Parameters

c1

Coroutine<A, B>

c2

Coroutine<B, C>

c3

Coroutine<C, D>

Returns

CoroutineLike<A, D>

Call Signature

cascade<T, R>(...tasks): CoroutineLike<T, R>

Defined in: operators/cascade.ts:49

Type Parameters

T

T = any

R

R = any

Parameters

tasks

...Coroutine<any, any>[]

Returns

CoroutineLike<T, R>

Released under the MIT License.