@szilanor/stream
    Preparing search index...

    Function distinctByAsync

    • Returns an AsyncOperationFunction that yields only entries of the source Iterable without duplicates.

      Type Parameters

      • T

        The type of the elements in the source Iterable.

      Parameters

      • equalsFunction: EqualsFunction<T> = ...

        The function to use to compare the elements.

      Returns AsyncOperationFunction<T, T>

      An AsyncOperationFunction that yields only entries of the source Iterable without duplicates.

      const result = distinctByAsync<number>([1, 2, 2, 3], (a, b) => a === b);
      console.log(result); // [1, 2, 3]