@szilanor/stream
    Preparing search index...

    Function minByAsync

    • Returns a collector that returns the smallest value of all entries in the Iterable based on the comparer function.

      Type Parameters

      • T

        Type of items in the source.

      Parameters

      • comparer: CompareFunction<T>

        A function that defines the sort order of the elements.

      Returns AsyncCollectorFunction<T, T | undefined>

      Collector that returns the smallest value of all entries in the Iterable based on the comparer function.

      const result = minByAsync((a, b) => a - b)([1, 2, 3]);
      console.log(result); // 1