Created
July 16, 2021 11:22
-
-
Save cmelchior/a465df7541ea2470d04c4a9902b9d818 to your computer and use it in GitHub Desktop.
Realm Kotlin 0.40 Release Blog Post - Observing Changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val jane = getJane() | |
CoroutineScope(Dispatchers.Main).launch { | |
// Updates are observed using Kotlin Flow | |
val flow: Flow<Person> = jane.observe() | |
flow.collect { | |
// Listen to changes to the object | |
println(it.name) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment