Skip to main content

IMapObserver

An observer that can subscribe to changes of an IObservableMap

Methods​

onAdded​

onAdded(index: string, item: ItemT, collection: Dictionary<ItemT>): void

Called when an item is added with the index, the new item, and current state of the collection.

ParameterType
indexstring
itemItemT
collectionDictionary<ItemT>

onCollectionUpdated​

onCollectionUpdated(collection: Dictionary<ItemT>): void

Called when a set of changes happens within the collection. For example, this can be used to get the initial state of the collection instead of receiving individual onAdded calls for each item.

ParameterType
collectionDictionary<ItemT>

onRemoved​

onRemoved(index: string, item: ItemT, collection: Dictionary<ItemT>): void

Called when an item is removed, with the index, the removed item, and current state of the collection.

ParameterType
indexstring
itemItemT
collectionDictionary<ItemT>

onUpdated​

onUpdated(index: string, item: ItemT, collection: Dictionary<ItemT>): void

Called when an existing item is altered, with the index, the new item, and current state of the collection.

ParameterType
indexstring
itemItemT
collectionDictionary<ItemT>