Interface ReactiveSet<TValue>

A reactive set inherited from Set. Changes to the set will be notified to subscribers of set.$.

interface ReactiveSet<TValue> {
    $: ReadonlyVal<ReactiveSet<TValue>>;
    [toStringTag]: string;
    size: number;
    [iterator](): IterableIterator<TValue>;
    add(value): this;
    batchAdd(values): this;
    batchDelete(values): boolean;
    clear(): void;
    delete(value): boolean;
    dispose(): void;
    entries(): IterableIterator<[TValue, TValue]>;
    forEach(callbackfn, thisArg?): void;
    has(value): boolean;
    keys(): IterableIterator<TValue>;
    replace(items): Iterable<TValue>;
    toJSON(): object[];
    values(): IterableIterator<TValue>;
}

Type Parameters

  • TValue

Hierarchy

Properties

A readonly val with value of this.

To update the entire reactive set in place, use set.replace().

[toStringTag]: string
size: number

Returns

the number of (unique) elements in Set.

Methods

  • Iterates over values in the set.

    Returns IterableIterator<TValue>

  • Appends a new element with a specified value to the end of the Set.

    Parameters

    Returns this

  • Returns void

  • Removes a specified value from the Set.

    Parameters

    Returns boolean

    Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns IterableIterator<[TValue, TValue]>

  • Executes a provided function once per each value in the Set object, in insertion order.

    Parameters

    • callbackfn: ((value, value2, set) => void)
        • (value, value2, set): void
        • Parameters

          Returns void

    • Optional thisArg: any

    Returns void

  • Parameters

    Returns boolean

    a boolean indicating whether an element with the specified value exists in the Set or not.

  • Despite its name, returns an iterable of the values in the set.

    Returns IterableIterator<TValue>

  • Returns an iterable of values in the set.

    Returns IterableIterator<TValue>