Join Slack
Powered by
Any particular reason why there's no `Flow<T>...
# 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 ?
mbonnin
07/22/2019, 1:42 PM
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
6
Views
Open in Slack
Previous
Next