Skip to content

Class: ObservableSet<T> ​

Defined in: mobx:

See ​

https://mobx.js.org/README.html

Type Parameters ​

Type ParameterDefault type
Tany

Implements ​

Accessors ​

[toStringTag] ​

Get Signature ​

ts
get toStringTag: string;

Defined in: mobx:

Returns ​

string

Implementation of ​

ts
Set.[toStringTag]

size ​

Get Signature ​

ts
get size(): number;

Defined in: mobx:

Returns ​

number

the number of (unique) elements in Set.

Implementation of ​

ts
Set.size

Constructors ​

Constructor ​

ts
new ObservableSet<T>(
   initialData?: IObservableSetInitialValues<T>, 
   enhancer?: IEnhancer<T>, 
name_?: string): ObservableSet<T>;

Defined in: mobx:

Parameters ​

ParameterType
initialData?IObservableSetInitialValues<T>
enhancer?IEnhancer<T>
name_?string

Returns ​

ObservableSet<T>

Methods ​

[iterator]() ​

ts
iterator: SetIterator<T>;

Defined in: mobx:

Returns ​

SetIterator<T>

Implementation of ​

ts
Set.[iterator]

add() ​

ts
add(value: T): this;

Defined in: mobx:

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

Parameters ​

ParameterType
valueT

Returns ​

this

Implementation of ​

ts
Set.add

clear() ​

ts
clear(): void;

Defined in: mobx:

Removes all elements from the Set.

Returns ​

void

Implementation of ​

ts
Set.clear

delete() ​

ts
delete(value: T): boolean;

Defined in: mobx:

Removes a specified value from the Set.

Parameters ​

ParameterType
valueT

Returns ​

boolean

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

Implementation of ​

ts
Set.delete

difference() ​

ts
difference<U>(otherSet: ReadonlySetLike<U>): Set<T>;

Defined in: mobx:

Type Parameters ​

Type Parameter
U

Parameters ​

ParameterType
otherSetReadonlySetLike<U>

Returns ​

Set<T>


entries() ​

ts
entries(): SetIterator<[T, T]>;

Defined in: mobx:

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

Returns ​

SetIterator<[T, T]>

Implementation of ​

ts
Set.entries

forEach() ​

ts
forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;

Defined in: mobx:

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

Parameters ​

ParameterType
callbackFn(value: T, value2: T, set: Set<T>) => void
thisArg?any

Returns ​

void

Implementation of ​

ts
Set.forEach

has() ​

ts
has(value: T): boolean;

Defined in: mobx:

Parameters ​

ParameterType
valueT

Returns ​

boolean

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

Implementation of ​

ts
Set.has

intercept_() ​

ts
intercept_(handler: IInterceptor<ISetWillChange<T>>): Lambda;

Defined in: mobx:

Parameters ​

ParameterType
handlerIInterceptor<ISetWillChange<T>>

Returns ​

Lambda


intersection() ​

ts
intersection<U>(otherSet: any): Set<T & U>;

Defined in: mobx:

Type Parameters ​

Type Parameter
U

Parameters ​

ParameterType
otherSetany

Returns ​

Set<T & U>


isDisjointFrom() ​

ts
isDisjointFrom(otherSet: any): boolean;

Defined in: mobx:

Parameters ​

ParameterType
otherSetany

Returns ​

boolean


isSubsetOf() ​

ts
isSubsetOf(otherSet: ReadonlySetLike<unknown>): boolean;

Defined in: mobx:

Parameters ​

ParameterType
otherSetReadonlySetLike<unknown>

Returns ​

boolean


isSupersetOf() ​

ts
isSupersetOf(otherSet: ReadonlySetLike<unknown>): boolean;

Defined in: mobx:

Parameters ​

ParameterType
otherSetReadonlySetLike<unknown>

Returns ​

boolean


keys() ​

ts
keys(): SetIterator<T>;

Defined in: mobx:

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

Returns ​

SetIterator<T>

Implementation of ​

ts
Set.keys

observe_() ​

ts
observe_(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda;

Defined in: mobx:

Parameters ​

ParameterType
listener(changes: ISetDidChange<T>) => void
fireImmediately?boolean

Returns ​

Lambda


replace() ​

ts
replace(other: 
  | ObservableSet<T>
| IObservableSetInitialValues<T>): ObservableSet<T>;

Defined in: mobx:

Parameters ​

ParameterType
other| ObservableSet<T> | IObservableSetInitialValues<T>

Returns ​

ObservableSet<T>


symmetricDifference() ​

ts
symmetricDifference<U>(otherSet: any): Set<T | U>;

Defined in: mobx:

Type Parameters ​

Type Parameter
U

Parameters ​

ParameterType
otherSetany

Returns ​

Set<T | U>


toJSON() ​

ts
toJSON(): T[];

Defined in: mobx:

Returns ​

T[]


toString() ​

ts
toString(): string;

Defined in: mobx:

Returns a string representation of an object.

Returns ​

string


union() ​

ts
union<U>(otherSet: any): Set<T | U>;

Defined in: mobx:

Type Parameters ​

Type Parameter
U

Parameters ​

ParameterType
otherSetany

Returns ​

Set<T | U>


values() ​

ts
values(): SetIterator<T>;

Defined in: mobx:

Returns an iterable of values in the set.

Returns ​

SetIterator<T>

Implementation of ​

ts
Set.values

Properties ​

[$mobx] ​

ts
[$mobx]: {
};

Defined in: mobx:


atom_ ​

ts
atom_: IAtom;

Defined in: mobx:


changeListeners_ ​

ts
changeListeners_: any;

Defined in: mobx:

Implementation of ​

IListenable.changeListeners_


dehancer ​

ts
dehancer: any;

Defined in: mobx:


enhancer_ ​

ts
enhancer_: (newV: any, oldV: any) => any;

Defined in: mobx:

Parameters ​

ParameterType
newVany
oldVany

Returns ​

any


interceptors_ ​

ts
interceptors_: any;

Defined in: mobx:

Implementation of ​

IInterceptable.interceptors_


name_ ​

ts
name_: string;

Defined in: mobx: