https://kotlinlang.org logo
#coroutines
Title
# coroutines
n

natario1

10/31/2020, 1:02 PM
Just getting started with coroutines here... Given a
val flow = MutableStateFlow<Boolean>(false)
, How to write a function that suspends until the flow value is true for the first time?
Copy code
suspend fun waitUntilTrue() { ... }
b

bezrukov

10/31/2020, 1:14 PM
Copy code
flow.first { it }
2
n

natario1

10/31/2020, 2:18 PM
Love it, thanks!
3 Views