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

    Function takeWhile

    • Emits values while predicate returns true, stopping and closing upstream on the first false result.

      Predicates run sequentially and may be asynchronous. Synchronous type guard predicates narrow the output stream type. The first non-matching value is consumed by the test and is not emitted.

      Type Parameters

      • T
      • S

      Parameters

      Returns Operator<T, S>

    • Emits values while predicate returns true, stopping and closing upstream on the first false result.

      Predicates run sequentially and may be asynchronous. Synchronous type guard predicates narrow the output stream type. The first non-matching value is consumed by the test and is not emitted.

      Type Parameters

      • T

      Parameters

      • predicate: (value: T, context: OperatorContext) => boolean | PromiseLike<boolean>

      Returns Operator<T, T>