Skip to main content

Function: dropWhileAsync()

Returns an async iterable containing the values of asyncIterable in iteration order starting with 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`]),
dropWhileAsync(value => value < 5),
reduceAsync(toArray()),
),
)
//=> [ 5, 6, 7, 8, 'sloth' ]

Since

v0.0.1

Call Signature

dropWhileAsync<Value>(fn): (asyncIterable) => AsyncIterable<Value, any, any>

Type Parameters

Value

Parameters

fn

(value) => unknown

Returns

Function

Parameters

asyncIterable

AsyncIterable<Value, any, any>

Returns

AsyncIterable<Value, any, any>

Defined in

splices.d.ts:50

Call Signature

dropWhileAsync<Value>(fn, asyncIterable): AsyncIterable<Value, any, any>

Type Parameters

Value

Parameters

fn

(value) => unknown

asyncIterable

AsyncIterable<Value, any, any>

Returns

AsyncIterable<Value, any, any>

Defined in

splices.d.ts:50