mogami-stream - v0.2.0
    Preparing search index...

    Function find

    • Returns the first value in source that satisfies predicate, or undefined if no value matches.

      Predicates are evaluated sequentially. As soon as a match is found, upstream is closed and the matched value is awaited before returning (while predicate itself receives the unawaited item). Synchronous type guard predicates narrow the return type.

      Type Parameters

      • T
      • S

      Parameters

      Returns Promise<Awaited<S> | undefined>

    • Returns the first value in source that satisfies predicate, or undefined if no value matches.

      Predicates are evaluated sequentially. As soon as a match is found, upstream is closed and the matched value is awaited before returning (while predicate itself receives the unawaited item). Synchronous type guard predicates narrow the return type.

      Type Parameters

      • T

      Parameters

      Returns Promise<Awaited<T> | undefined>