Class: ObservableMap<K, V>
Defined in: mobx:
See
https://mobx.js.org/README.html
Type Parameters
| Type Parameter | Default type |
|---|---|
K | any |
V | any |
Implements
Map<K,V>IInterceptable<IMapWillChange<K,V>>IListenable
Accessors
[toStringTag]
Get Signature
get toStringTag: string;Defined in: mobx:
Returns
string
Implementation of
Map.[toStringTag]size
Get Signature
get size(): number;Defined in: mobx:
Returns
number
the number of elements in the Map.
Implementation of
Map.sizeConstructors
Constructor
new ObservableMap<K, V>(
initialData?: IObservableMapInitialValues<K, V>,
enhancer_?: IEnhancer<V>,
name_?: string): ObservableMap<K, V>;Defined in: mobx:
Parameters
| Parameter | Type |
|---|---|
initialData? | IObservableMapInitialValues<K, V> |
enhancer_? | IEnhancer<V> |
name_? | string |
Returns
ObservableMap<K, V>
Methods
[iterator]()
iterator: MapIterator<IMapEntry<K, V>>;Defined in: mobx:
Returns
MapIterator<IMapEntry<K, V>>
Implementation of
Map.[iterator]clear()
clear(): void;Defined in: mobx:
Removes all elements from the Map.
Returns
void
Implementation of
Map.cleardelete()
delete(key: K): boolean;Defined in: mobx:
Parameters
| Parameter | Type |
|---|---|
key | K |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Implementation of
Map.deleteentries()
entries(): MapIterator<IMapEntry<K, V>>;Defined in: mobx:
Returns an iterable of key, value pairs for every entry in the map.
Returns
MapIterator<IMapEntry<K, V>>
Implementation of
Map.entriesforEach()
forEach(callback: (value: V, key: K, object: Map<K, V>) => void, thisArg?: any): void;Defined in: mobx:
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
| Parameter | Type |
|---|---|
callback | (value: V, key: K, object: Map<K, V>) => void |
thisArg? | any |
Returns
void
Implementation of
Map.forEachget()
get(key: K): V | undefined;Defined in: mobx:
Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
Parameters
| Parameter | Type |
|---|---|
key | K |
Returns
V | undefined
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Implementation of
Map.gethas()
has(key: K): boolean;Defined in: mobx:
Parameters
| Parameter | Type |
|---|---|
key | K |
Returns
boolean
boolean indicating whether an element with the specified key exists or not.
Implementation of
Map.hasintercept_()
intercept_(handler: IInterceptor<IMapWillChange<K, V>>): Lambda;Defined in: mobx:
Parameters
| Parameter | Type |
|---|---|
handler | IInterceptor<IMapWillChange<K, V>> |
Returns
keys()
keys(): MapIterator<K>;Defined in: mobx:
Returns an iterable of keys in the map
Returns
MapIterator<K>
Implementation of
Map.keysmerge()
merge(other?: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;Defined in: mobx:
Merge another object into this object, returns this.
Parameters
| Parameter | Type |
|---|---|
other? | IObservableMapInitialValues<K, V> |
Returns
ObservableMap<K, V>
observe_()
observe_(listener: (changes: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;Defined in: mobx:
Observes this object. Triggers for the events 'add', 'update' and 'delete'. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe for callback details
Parameters
| Parameter | Type |
|---|---|
listener | (changes: IMapDidChange<K, V>) => void |
fireImmediately? | boolean |
Returns
replace()
replace(values: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;Defined in: mobx:
Parameters
| Parameter | Type |
|---|---|
values | IObservableMapInitialValues<K, V> |
Returns
ObservableMap<K, V>
set()
set(key: K, value: V): this;Defined in: mobx:
Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Parameters
| Parameter | Type |
|---|---|
key | K |
value | V |
Returns
this
Implementation of
Map.settoJSON()
toJSON(): [K, V][];Defined in: mobx:
Returns
[K, V][]
toString()
toString(): string;Defined in: mobx:
Returns a string representation of an object.
Returns
string
values()
values(): MapIterator<V>;Defined in: mobx:
Returns an iterable of values in the map
Returns
MapIterator<V>
Implementation of
Map.valuesProperties
[$mobx]
[$mobx]: {
};Defined in: mobx:
changeListeners_
changeListeners_: any;Defined in: mobx:
Implementation of
data_
data_: Map<K, ObservableValue<V>>;Defined in: mobx:
dehancer
dehancer: any;Defined in: mobx:
enhancer_
enhancer_: IEnhancer<V>;Defined in: mobx:
hasMap_
hasMap_: Map<K, ObservableValue<boolean>>;Defined in: mobx:
interceptors_
interceptors_: any;Defined in: mobx:
Implementation of
keysAtom_
keysAtom_: IAtom;Defined in: mobx:
name_
name_: string;Defined in: mobx: