ursus
03/06/2022, 11:51 PMflow.first { .. }
to suspend till a value I want is emitted and then continue in “suspend functions world” with my logic more idiomatic than take(1)
(and keeping the logic reactive)?
or rather is there some technical difference between flow.filter { … }
and flow.first { .. }
? I mean they both “wait” by suspending the coroutine, right?streetsofboston
03/07/2022, 12:21 AMstreetsofboston
03/07/2022, 12:23 AMursus
03/07/2022, 1:24 AMflow
.filter { .. }
.take(1)
.collect {
// logic
}
vs
flow.first { .. }
// logic
Dan Fingal-Surma
03/07/2022, 4:43 AMDan Fingal-Surma
03/07/2022, 4:43 AMDan Fingal-Surma
03/07/2022, 4:43 AMursus
03/07/2022, 12:06 PMstreetsofboston
03/07/2022, 12:49 PMDan Fingal-Surma
03/08/2022, 4:17 AM