@szilanor/stream
    Preparing search index...

    Variable findAsyncConst

    findAsync: <T>(
        predicate?: MaybeAsyncPredicateFunction<T>,
    ) => AsyncCollectorFunction<T, T | undefined> = firstAsync

    Type Declaration

      • <T>(
            predicate?: MaybeAsyncPredicateFunction<T>,
        ): AsyncCollectorFunction<T, T | undefined>
      • Returns a collector that returns the first entry from the Iterable that satisfies the 'predicate' function.

        Type Parameters

        • T

          Type of items in the source.

        Parameters

        Returns AsyncCollectorFunction<T, T | undefined>

        Collector that returns the first entry from the Iterable that satisfies the 'predicate' function.

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