Documentation / @eventkit/base / count
Function: count()
ts
function count<T>(predicate?): SingletonOperatorFunction<T, number>
Counts the number of items emitted by the source observable, and emits that number when the source observable completes.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
predicate ? | (value , index ) => boolean | A function that is used to analyze the value and the index and determine whether or not to increment the count. Return true to increment the count, and return false to keep the count the same. If the predicate is not provided, every value will be counted. |
Returns
SingletonOperatorFunction
<T
, number
>