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

    Function scan

    • Reduces values sequentially and emits the updated accumulator after each item.

      initial is awaited before opening the upstream source and is not emitted on its own (an empty source emits nothing). Objects resolved from initial are used by reference.

      Type Parameters

      • T
      • A

      Parameters

      • reducer: (
            accumulator: Awaited<A>,
            value: T,
            context: OperatorContext,
        ) => Awaited<A> | PromiseLike<Awaited<A>>
      • initial: A

      Returns Operator<T, Awaited<A>>