Skip to content

ReadOnlyObservableMap

github-actions[bot] edited this page Dec 3, 2024 · 3 revisions
API / ReadOnlyObservableMap<TKey, TItem> class

Represents a read-only observable map based on the Map interface.

Extends ViewModel.
Implements IReadOnlyObservableMap<TKey, TItem>.

class ReadOnlyObservableMap<TKey, TItem>
    extends ViewModel
    implements IReadOnlyObservableMap<TKey, TItem>

Source reference: src/collections/observableMap/ReadOnlyObservableMap.ts:12.

Generic Parameters

  • TKey - The type of keys the map contains.

  • TItem - The type of items the map contains.

Constructors

Properties

  • readonly mapChanged - An event that is raised when the map changed by adding or removing entries.
  • size - Gets the number of entries in the map.
  • inherited propertiesChanged - An event that is raised when one or more properties may have changed.

Methods

  • [iterator] - Gets an iterator that provides each element in the map in an key-item tupple.
  • entries - Gets an iterator that provides each element in the map in an key-item tupple.
  • forEach - Iterates over the entire map executing the callback for each pair.
  • get - Looks up provided key and returns the associated item if one exists; otherwise undefined.
  • has - Checks whether there is a value associated with the provided key.
  • keys - Gets an iterator that provides each key in the map.
  • toMap - Converts the observable map to a native JavaScript Map.
  • values - Gets an iterator that provides each item in the map.
  • protected clear - Empties the map of all entries.
  • protected delete - Removes the entry having the given given key from the map.
  • protected set - Sets the provided item at the given key. If there is an entry already exists with the given key, then it is replaced.

Inheritance Hierarchy

Clone this wiki locally