SyncDocumentObserver

abstract class SyncDocumentObserver : Disposable

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

Functions

Link copied to clipboard
open fun dispose()
Link copied to clipboard
open fun onErrorOccurred(error: ErrorInfo)
This callback is invoked when a SyncDocument operation has encountered an error.
Link copied to clipboard
open fun onOpened(doc: SyncDocument)
This callback is invoked when SyncDocument object has been initialised and opened locally.
Link copied to clipboard
open fun onRemoved(context: EventContext, previousData: JSONObject)
This callback is invoked when entire SyncDocument has been removed by a local request.
Link copied to clipboard
open fun onUpdated(    context: EventContext,     data: JSONObject,     previousData: JSONObject)
This callback is invoked when a SyncDocument has been modified by a local request.