Skip to main content

Function: takeWhileConcur()

Returns a concur iterable containing the values of concurIterable in iteration order up until but not including the first value for which fn returns a value awaitable to a falsy value.

Example

console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, 6, 7, 8, `sloth`]),
takeWhileConcur(value => value < 5),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3, 4 ]

takeWhileConcur(fn)

takeWhileConcur<Value>(fn): (concurIterable) => ConcurIterable<Value>

Returns a concur iterable containing the values of concurIterable in iteration order up until but not including the first value for which fn returns a value awaitable to a falsy value.

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, 6, 7, 8, `sloth`]),
takeWhileConcur(value => value < 5),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3, 4 ]

Defined in

splices.d.ts:132

takeWhileConcur(fn, concurIterable)

takeWhileConcur<Value>(fn, concurIterable): ConcurIterable<Value>

Returns a concur iterable containing the values of concurIterable in iteration order up until but not including the first value for which fn returns a value awaitable to a falsy value.

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, 6, 7, 8, `sloth`]),
takeWhileConcur(value => value < 5),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3, 4 ]

Defined in

splices.d.ts:132