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

dave08

02/10/2020, 5:15 PM
Is it on purpose that
Flow
has
singleOrNull
but not
firstOrNull
?
d

diesieben07

02/10/2020, 6:37 PM
Considering flows are ordered, they would do the exact same thing, no?
d

dave08

02/10/2020, 8:09 PM
Single throws if there's more than one emission
d

diesieben07

02/10/2020, 8:40 PM
You're right.
b

bdawg.io

02/11/2020, 3:16 AM
Probably more along the lines that there wasn't a use case requested and therefore wasn't added during the preview :)
Looks like it was intentional due to lack of use case given during the preview https://github.com/Kotlin/kotlinx.coroutines/issues/1078
👍 1
BUT thanks to the world of OSS -- you can 👍 it here: https://github.com/Kotlin/kotlinx.coroutines/pull/1796
d

dave08

02/11/2020, 4:24 AM
And thanks for the PR 😉!
5 Views