SyncMapObserver

abstract class SyncMapObserver : Disposable

Observer for all operations on a SyncMap. You should create your own subclass of MapObserver and override functions you are interested in. Observer will receive callbacks for all operations on a SyncMap. To distinguish parallel streams of local operations your application could use local flow identifier. Callbacks in the observer will be called from a background thread. You will need to repost your work to UI thread if you do any UI-related operations in the callback.

Constructors

Link copied to clipboard
open fun SyncMapObserver()
Keep default constructor, you don't need to override it.

Functions

Link copied to clipboard
open fun dispose()
Link copied to clipboard
open fun onCollectionRemoved(context: EventContext)
This callback is invoked when the entire SyncMap has been removed.
Link copied to clipboard
open fun onErrorOccurred(error: ErrorInfo)
This callback is invoked when a SyncMap operation has encountered a error in local request.
Link copied to clipboard
open fun onItemAdded(context: EventContext, item: SyncMap.Item)
This callback is invoked when SyncMap item has been added.
Link copied to clipboard
open fun onItemRemoved(    context: EventContext,     itemKey: String,     previousItemData: JSONObject)
This callback is invoked when SyncMap item has been removed.
Link copied to clipboard
open fun onItemUpdated(    context: EventContext,     item: SyncMap.Item,     previousItemData: JSONObject)
This callback is invoked when SyncMap item has been updated.
Link copied to clipboard
open fun onOpened(syncMap: SyncMap)
This callback is invoked when SyncMap object has been initialised and opened locally.