Max Kachinkin
09/15/2021, 5:07 PMwasyl
09/15/2021, 9:34 PMMax Kachinkin
09/15/2021, 9:39 PMwasyl
09/16/2021, 6:05 AMsingle()
or first()
. However, if thereâs just one value, and youâd use Single<T>
in RxJava, then idiomatic coroutines equivalent is a suspend fun
.
Do you have some specific example where youâd like to use a potential SingleFlow
with operators?Max Kachinkin
09/16/2021, 6:30 AMyou can use operators likeÂFor now iâm trying to use orÂsingle()
.first()
take(1)
for it.Max Kachinkin
09/16/2021, 6:34 AMDo you have some specific example where youâd like to use a potentialÂThere is no any specific example. Itâs all common cases like Basically, I donât like combining two approaches in project. Like this:Â with operators?SingleFlow
interface A {
fun foo(): Flow<String>
suspend bar(): String
}
Because I will need to process them a little differently.wasyl
09/16/2021, 6:52 AMMax Kachinkin
09/16/2021, 6:54 AMpsh
09/16/2021, 8:18 PMCompletable
and Single
over to suspending functions and a few of our dyed-in-the-wool Rx folk were skeptical, but we all now agree that it was well worth the effort - code greatly simplified and testing was much easier. I think the biggest âaha!â / âOhh, shiny!â moment came when we discovered suspending lambdas đMax Kachinkin
09/16/2021, 8:31 PM