kotlin-extensions / io.realm.kotlin

Package io.realm.kotlin

Extensions for External Classes

io.realm.DynamicRealm

io.realm.Realm

io.realm.RealmList

io.realm.RealmModel

io.realm.RealmQuery

io.realm.RealmResults

Functions

addChangeListener

Adds a change listener to a RealmObject that will be triggered if any value field or referenced RealmObject field is changed, or the RealmList field itself is changed.

fun <E : RealmModel> E.addChangeListener(listener: RealmChangeListener<E>): Unit

Adds a change listener to a RealmObject to get detailed information about the changes. The listener will be triggered if any value field or referenced RealmObject field is changed, or the RealmList field itself is changed.

fun <E : RealmModel> E.addChangeListener(listener: RealmObjectChangeListener<E>): Unit

removeChangeListener

Removes a previously registered listener on the given RealmObject.

fun <E : RealmModel> E.removeChangeListener(listener: RealmChangeListener<E>): Unit
fun <E : RealmModel> E.removeChangeListener(listener: RealmObjectChangeListener<E>): Unit

toChangesetFlow

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

fun <T : RealmModel> T?.toChangesetFlow(): Flow<ObjectChange<T>?>

toFlow

Returns a Flow that monitors changes to this RealmObject. It will emit the current RealmObject upon subscription. Object updates will continually be emitted as the RealmObject is updated - onCompletion will never be called.

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