Skip to content

fx-flow v0.7.0 / pipe/lazy / takeUntil

Function: takeUntil()

takeUntil(fn, iterable)

takeUntil<A>(fn, iterable): IterableIterator<A>

Take values from iterable/AsyncIterable until fn returns true

Type parameters

A

Parameters

fn

iterable: Iterable<A>

Returns

IterableIterator<A>

Example

typescript
const iterator =  filter((v) => v > 2, [1, 3, 4])
iterator.next().value = 1
iterator.next().value = 3
iterator.next().done = true

More examples

Source

packages/core/src/pipe/lazy/takeUntil.ts:85

takeUntil(fn, iterable)

takeUntil<A>(fn, iterable): AsyncIterableIterator<A>

Type parameters

A

Parameters

fn

iterable: AsyncIterable<A>

Returns

AsyncIterableIterator<A>

Source

packages/core/src/pipe/lazy/takeUntil.ts:86

takeUntil(fn)

takeUntil<A>(fn): (iterable) => IteratorReturnValue<A>

Type parameters

A extends UniversalIterable

Parameters

fn

Returns

Function

Parameters

iterable: A

Returns

IteratorReturnValue<A>

Source

packages/core/src/pipe/lazy/takeUntil.ts:87

Released under the MIT License.