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

    Interface OwnedReactiveSet<V>

    interface OwnedReactiveSet<V> {
        "[toStringTag]": string;
        onDisposeValue: <V>(
            this: { onDisposeValue_?: null | OnDisposeValue<V> },
            fn: (value: V) => void,
        ) => RemoveListener;
        size: number;
        get $(): Readable<ReadonlyReactiveSet<V>>;
        "[iterator]"(): SetIterator<V>;
        add(value: V): this;
        clear(): void;
        delete(value: V): boolean;
        difference<U>(other: ReadonlySetLike<U>): Set<V>;
        dispose(): void;
        entries(): SetIterator<[V, V]>;
        forEach(
            callbackfn: (value: V, value2: V, set: Set<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;
        symmetricDifference<U>(other: ReadonlySetLike<U>): Set<V | U>;
        union<U>(other: ReadonlySetLike<U>): Set<V | U>;
        values(): SetIterator<V>;
    }

    Type Parameters

    • V

    Hierarchy

    • Set<V>
      • OwnedReactiveSet

    Implements

    Index

    Properties

    "[toStringTag]": string
    onDisposeValue: <V>(
        this: { onDisposeValue_?: null | OnDisposeValue<V> },
        fn: (value: V) => void,
    ) => RemoveListener = onDisposeValue

    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.

    Type declaration

      • <V>(
            this: { onDisposeValue_?: null | OnDisposeValue<V> },
            fn: (value: V) => void,
        ): RemoveListener
      • Type Parameters

        • V

        Parameters

        • this: { onDisposeValue_?: null | OnDisposeValue<V> }
        • 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.

    size: number

    the number of (unique) elements in Set.

    Accessors

    Methods

    • Iterates over values in the set.

      Returns SetIterator<V>

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

      Parameters

      • value: V

      Returns this

    • Removes a specified value from the Set.

      Parameters

      • value: V

      Returns boolean

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

    • 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]>

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

      Parameters

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

      Returns void

    • Parameters

      • value: V

      Returns boolean

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

    • 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>

    • 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>