Skip to main content

Variable: takeWhileAsync

const takeWhileAsync: SubWhileAsync

Defined in: splices.d.ts:116

Returns an async iterable containing the values of asyncIterable 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(
asAsync([1, 2, 3, 4, 5, 6, 7, 8, `sloth`]),
takeWhileAsync(value => value < 5),
reduceAsync(toArray()),
),
)
//=> [ 1, 2, 3, 4 ]

Since

v0.0.1