ditto-lib / live.ditto / DittoPendingCursorOperation / subscribe

subscribe

fun subscribe(): DittoSubscription

Enables you to subscribe to changes that occur on a collection. Having a subscription acts as a signal to others that you are interested in receiving updates when local or remote changes are made to documents that match the query generated by the chain of operations that precedes the call to subscribe. The returned DittoSubscription object must be kept in scope for as long as you want to keep receiving updates.

Return
a DittoSubscription object that must be kept in scope for as long as you want to keep receiving updates for documents that match the query specified in the preceding chain.