@jiway/firestorm-core - v1.1.1
    Preparing search index...

    Function distinctWithKey

    • Removes the duplicates in an array.

      It is O(n) in complexity but you must an hashing function without collision

      Type Parameters

      • T

        Type of the items in the array

      • K

        Type of the key, it must be a base type.

      Parameters

      • sourceArray: T[]

        Array from which to remove the duplicates

      • hashingFn: (item: T) => K

        The function that is used to get an hash of the item to enable hashing. It MUST have no collision.

      Returns T[]

      A copy of the array without duplicates.