A Set that supports observability.

Type Parameters

  • T

Hierarchy

Implements

  • Set<T>

Constructors

Properties

_originalSet: Set<T>

The underlying set that this class is wrapping.

[toStringTag] = "ObservableSet"

Used by Object.toString().

@eventTypes: SetEvents<T>

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

Accessors

  • get size(): number
  • The number of elements in the set.

    Returns number

Methods

  • Returns each element in the set in insertion order.

    Returns SetIterator<T>

  • Adds an element to the set.

    Parameters

    • value: T

      The value to add.

    Returns this

  • Adds elements to the set.

    Parameters

    • values: Iterable<T, any, any>

      The values to add.

    Returns this

  • Removes all elements.

    Returns void

  • Removes the specified element.

    Parameters

    • value: T

      The element to remove.

    Returns boolean

    True if an element was deleted, otherwise false.

  • Removes the specified elements.

    Parameters

    • values: Iterable<T, any, any>

      The elements to remove.

    Returns boolean

    True if an element was deleted, otherwise false.

  • Returns each element in the set in insertion order.

    Returns SetIterator<[T, T]>

  • Executes a provided function once per each element in the set.

    Parameters

    • callbackfn: ((value: T, value2: T, set: Set<T>) => void)

      Function to execute for each element.

        • (value, value2, set): void
        • Parameters

          • value: T
          • value2: T
          • set: Set<T>

          Returns void

    • OptionalthisArg: unknown

      Value to use as this when executing callback.

    Returns void

  • Indicates whether or not the set contains the specified element.

    Parameters

    • value: T

      The element to test for.

    Returns boolean

  • Returns each element in the set in insertion order.

    Returns SetIterator<T>

  • Returns a serializable representation of the set.

    Returns unknown

  • Returns each element in the set in insertion order.

    Returns SetIterator<T>