kotlin-extensions / io.realm.kotlin / io.realm.RealmResults

Extensions for io.realm.RealmResults

toChangesetFlow

Returns a Flow that monitors changes to this RealmResults. It will emit the current RealmResults upon subscription. For each update to the RealmResults a CollectionChange consisting of a pair with the RealmResults and its corresponding OrderedCollectionChangeSet will be sent. The changeset will be null the first time the RealmResults is emitted.

fun <T : RealmModel> RealmResults<T>.toChangesetFlow(): Flow<CollectionChange<RealmResults<T>>>

toFlow

Returns a Flow that monitors changes to this RealmResults. It will emit the current RealmResults when subscribed to. RealmResults will continually be emitted as the RealmResults are updated - onCompletion will never be called.

fun <T : RealmModel> RealmResults<T>.toFlow(): Flow<RealmResults<T>>