ditto-lib / live.ditto / DittoPendingIDSpecificOperation / subscribe

subscribe

fun subscribe(): DittoSubscription

Enables you to subscribe to changes that occur in relation to a document. Having a subscription acts as a signal to other peers that you are interested in receiving updates when local or remote changes are made to the relevant document. 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.