IMapObserver Interface<ItemT>

An observer that can subscribe to changes of an IObservableMap

Type parameters

  • ItemT

    The type of the items in the map.

Hierarchy

  • IMapObserver
Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.

Index

Methods

Optional 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.

    Parameters

    • index: string
    • item: ItemT
    • collection: Dictionary<ItemT>

    Returns void

Optional 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.

    Parameters

    Returns void

Optional 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.

    Parameters

    • index: string
    • item: ItemT
    • collection: Dictionary<ItemT>

    Returns void

Optional 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.

    Parameters

    • index: string
    • item: ItemT
    • collection: Dictionary<ItemT>

    Returns void