Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / aggregates/src/public-api / count

Function: count()

count<T>(): Operator<T, number>

Defined in: projects/libraries/streamix/aggregates/src/lib/operators/count.ts:14

Creates a stream operator that counts the number of items emitted by the source stream.

This operator consumes every value from the source without emitting until the upstream completes. After the source finishes, it emits exactly one number: the total count of consumed values (zero if nothing arrived), and then the operator completes.

Type Parameters

T

T = any

The type of the values in the source stream.

Returns

Operator<T, number>

An Operator instance that can be used in a stream's pipe method.

Released under the GNU AGPL v3 or later.