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

Eric Martori

08/14/2019, 11:55 AM
Would it be posible to include:
Copy code
suspend fun <T> Flow<T>.first() = take(1).single()
In the flow API?
i

Icaro Temponi

08/14/2019, 12:03 PM
first() already exists in 1.3.0-RC2
the implementation
e

Eric Martori

08/14/2019, 12:15 PM
Thank you, for some reason I didn't check the RCs
With this implementation this will not work with
flows
that accept nullable values, right?
i

Icaro Temponi

08/14/2019, 12:26 PM
yeah, should work
No problems here
e

Eric Martori

08/14/2019, 12:32 PM
I see, I just read
NULL
as
null
and it confused me while reading the code. Thank you
b

bdawg.io

08/14/2019, 5:16 PM
maybe they should rename that constant to UNDEFINED 😆
i

Icaro Temponi

08/14/2019, 6:33 PM
That would be a good idea 😂
4 Views