@cprecioso/async-iterable-helpers
    Preparing search index...

    Function reduce

    • Folds the iterable into a single value by applying fn to an accumulator and each item. The reducer may be async; its result is awaited.

      Type Parameters

      • T
      • U

      Parameters

      • fn: (acc: U, item: Awaited<T>) => U | Promise<U>

        Combines the accumulator with the next item.

      • initialValue: U

        The accumulator's starting value.

      Returns SinkFn<T, U>

      A sink resolving to the final accumulated value.