observeLocal

fun observeLocal(eventHandler: (DittoCollectionsEvent) -> Unit): DittoLiveQuery

Enables you to listen for changes that occur in relation to the collections that are known about locally.

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.

Return

a DittoLiveQuery object that must be kept in scope for as long as you want to keep receiving updates.

Parameters

eventHandler

a closure that will be called every time there is an update about the list of known about collections.

fun observeLocal(callback: DittoCollectionsCallback): DittoLiveQuery

Enables you to listen for changes that occur in relation to the collections that are known about locally.

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.

Return

a DittoLiveQuery object that must be kept in scope for as long as you want to keep receiving updates.

Parameters

callback

an object that implements the DittoLiveQueryCallback interface, whose update function will be called every time there is an update about the list of known about collections.