@szilanor/stream
    Preparing search index...

    Variable lengthAsyncConst

    lengthAsync: <T>(
        predicateFunction?: PredicateFunction<T>,
    ) => AsyncCollectorFunction<T, number> = countAsync

    Type Declaration

      • <T>(predicateFunction?: PredicateFunction<T>): AsyncCollectorFunction<T, number>
      • Returns a collector that returns the number of entries in the Iterable.

        Type Parameters

        • T

          Type of items in the source.

        Parameters

        • predicateFunction: PredicateFunction<T> = ...

          A function that tests each entry for a condition.

        Returns AsyncCollectorFunction<T, number>

        Collector that returns the number of entries in the Iterable.

        const result = countAsync((x) => x > 0)([1, 2, 3]);
        console.log(result); // 3