Skip to content

countAsync

countAsync(iterable, signal?): Promise<number>

Defined in: packages/core/src/iterable/async/count.ts:16

Counts the elements of an iterable, consuming it.

The async counterpart of count, without its O(1) fast paths: a stream has no size to read.

Time complexity: O(n).

MaybeAsyncIterable<unknown>

The iterable to count, sync or async.

AbortSignal

Aborts the count.

Promise<number>

How many elements it yielded.