ditto-lib / live.ditto / DittoPendingCursorOperation / observeLocal

observeLocal

fun observeLocal(eventHandler: (List<DittoDocument<T>>, DittoLiveQueryEvent<T>) -> Unit): DittoLiveQuery<T>
fun observeLocal(callback: DittoLiveQueryCallback<T>): DittoLiveQuery<T>

Enables you to listen for changes that occur on a collection. 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 call subscribe with the relevant query. The returned DittoLiveQuery object must be kept in scope for as long as you want the provided eventHandler to be called when an update occurs.