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

mbonnin

07/22/2019, 1:26 PM
Any particular reason why there's no
Flow<T>.firstOrNull(): T?
Or did I miss it ?
Some discussion over there: https://github.com/Kotlin/kotlinx.coroutines/issues/1078#issuecomment-481346907. I guess it has to do with the fact that you can't distinguish an empty flow from a first null item but I'm still wrapping my head around that
d

Dico

07/22/2019, 2:09 PM
You could restrict the type to
<T : Any>
👍 2
5 Views