Function asSet

  • Returns a Set-like view of the given array.

    For plain arrays, the set interface is backed by the array, ensuring values appear only once. For observable arrays, mutations are wrapped in actions using MobX.

    Type Parameters

    • T

      The type of the values.

    Parameters

    • data: T[]

      An array to be wrapped as a Set.

    Returns Set<T>

    A Set-like view over the array.

    When data is not an array.