SyncListObserver

abstract class SyncListObserver : Disposable

Observer for all operations on a SyncList. You should create your own subclass of ListObserver and override functions you are interested in. Observer will receive callbacks for all operations on a SyncList. 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
constructor()
Keep default constructor, you don't need to override it.

Functions

Link copied to clipboard
open fun dispose()
Link copied to clipboard
This callback is invoked when an entire SyncList has been removed by a local request.
Link copied to clipboard
open fun onErrorOccurred(error: ErrorInfo)
This callback is invoked when a SyncList operation has encountered an error.
Link copied to clipboard
open fun onItemAdded(context: EventContext, item: SyncList.Item)
This callback is invoked when SyncList item has been added by a local request.
Link copied to clipboard
open fun onItemRemoved(context: EventContext, itemIndex: Long, previousItemData: JSONObject)
This callback is invoked when SyncList item has been removed by a local request.
Link copied to clipboard
open fun onItemUpdated(context: EventContext, item: SyncList.Item, previousItemData: JSONObject)
This callback is invoked when SyncList item has been updated by a local request.
Link copied to clipboard
open fun onOpened(syncList: SyncList)
This callback is invoked when SyncList object has been initialised and opened locally.