ditto-lib / live.ditto / DittoPendingIDSpecificOperation / observeLocal

observeLocal

fun observeLocal(eventHandler: (DittoSingleDocumentLiveQueryEvent<T>) -> Unit): DittoSingleDocumentLiveQuery<T>
fun observeLocal(callback: DittoSingleDocumentLiveQueryCallback<T>): DittoSingleDocumentLiveQuery<T>

Enables you to listen for changes that occur in relation to a document. This won't subscribe to receive changes made remotely by others and so it will only fire updates when a local change is made. If you want to receive remotely performed updates as well then use observe or also call subscribe separately after another findByID call that references the same document ID. The returned DittoSingleDocumentLiveQuery object must be kept in scope for as long as you want the provided eventHandler to be called when an update occurs.