Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.
Type parameters
-
ItemT
The type of the items in the map being observed.
Hierarchy
- IObservableMap
Index
Methods
Methods
subscribe
-
Subscribe to changes in this map. When this observable detects a change, the
observer
provided will have itsonAdded
,onRemoved
, and/oronUpdated
called.Parameters
-
observer: IMapObserver<ItemT>
Returns ISubscription
A subscription that can be used to remove the subscribed observer.
-
A map that can have its changes observed via subscribing an IMapObserver
For each observer subscribed to this
IObservableMap
:observer.onAdded
will be called when an item is added to the collectionobserver.onRemoved
will be called when an item is removed from the collectionobserver.onUpdated
will be called when an item has some of its properties changedobserver.onCollectionUpdated
will be called when some set of the above events have occured (item added/removed/updated)When first subscribing, the observers'
onAdded
will be called for each item in the collection, and then again as items are added. Alternatively, theonCollectionUpdated
will always give an up-to-date view of the collection.onCollectionUpdated
, on first subscription, will be called once with the entire collection, and then again as changes to the collection occur.