@embra/reactivity - v0.0.3
    Preparing search index...

    Interface ReadonlyReactiveSet<V>

    interface ReadonlyReactiveSet<V> {
        $: Readable<ReadonlySet<V>>;
        size: number;
        "[iterator]"(): SetIterator<V>;
        difference<U>(other: ReadonlySetLike<U>): Set<V>;
        entries(): SetIterator<[V, V]>;
        forEach(
            callbackfn: (value: V, value2: V, set: ReadonlySet<V>) => void,
            thisArg?: any,
        ): void;
        has(value: V): boolean;
        intersection<U>(other: ReadonlySetLike<U>): Set<V & U>;
        isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
        isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
        isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
        keys(): SetIterator<V>;
        onChanged(fn: (changed: ReactiveSetChanged<V>) => void): RemoveListener;
        onDisposeValue(fn: (value: V) => void): RemoveListener;
        symmetricDifference<U>(other: ReadonlySetLike<U>): Set<V | U>;
        union<U>(other: ReadonlySetLike<U>): Set<V | U>;
        values(): SetIterator<V>;
    }

    Type Parameters

    • V

    Hierarchy

    • ReadonlySet<V>
      • ReadonlyReactiveSet
    Index

    Properties

    $: Readable<ReadonlySet<V>>
    size: number

    Methods

    • Iterates over values in the set.

      Returns SetIterator<V>

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V>

      a new Set containing all the elements in this Set which are not also in the argument.

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

      Returns SetIterator<[V, V]>

    • Parameters

      • callbackfn: (value: V, value2: V, set: ReadonlySet<V>) => void
      • OptionalthisArg: any

      Returns void

    • Parameters

      • value: V

      Returns boolean

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V & U>

      a new Set containing all the elements which are both in this Set and in the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether this Set has no elements in common with the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether all the elements in this Set are also in the argument.

    • Parameters

      • other: ReadonlySetLike<unknown>

      Returns boolean

      a boolean indicating whether all the elements in the argument are also in this Set.

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

      Returns SetIterator<V>

    • Subscribe to events when a value is needed to be disposed.

      A value is considered for disposal when:

      • it is deleted from the set.
      • it is replaced by another value (the old value is removed).
      • it is cleared from the set.
      • the set is disposed.

      Parameters

      • fn: (value: V) => void

        The function to call when a value is needed to be disposed.

      Returns RemoveListener

      A disposer function to unsubscribe from the event.

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V | U>

      a new Set containing all the elements which are in either this Set or in the argument, but not in both.

    • Type Parameters

      • U

      Parameters

      • other: ReadonlySetLike<U>

      Returns Set<V | U>

      a new Set containing all the elements in this Set and also all the elements in the argument.

    • Returns an iterable of values in the set.

      Returns SetIterator<V>