IMapObserver
An observer that can subscribe to changes of an IObservableMap
Methods
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.
| Parameter | Type |
|---|---|
| index | string |
| item | ItemT |
| collection | Dictionary<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.
| Parameter | Type |
|---|---|
| collection | Dictionary<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.
| Parameter | Type |
|---|---|
| index | string |
| item | ItemT |
| collection | Dictionary<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.
| Parameter | Type |
|---|---|
| index | string |
| item | ItemT |
| collection | Dictionary<ItemT> |