Tunji Dahunsi
02/21/2025, 6:14 PMdo {
invoke a suspending method that increments a counter or something
} while {
another suspending method suspends
}
Where both invocations are simultaneously suspending and executing.
This would be similar to Flow.takeWhile
but without using the flow API. Or even a clever way to do this with coroutineScope
and async
operatorsTunji Dahunsi
02/21/2025, 6:18 PMdo {
while(true) {
++counter
delay(100)
}
} while {
snapshotFlow { value }
.first { it is State.Completed }
}
Tunji Dahunsi
02/21/2025, 6:19 PMFlow.takeWhile
, just curious if I can do it with regular suspending methodsjw
02/21/2025, 6:19 PMlaunch
the "do", cancel the returned Job
once the "while" completesTunji Dahunsi
02/21/2025, 6:21 PMLaunchedEffect
was offZach Klippenstein (he/him) [MOD]
02/21/2025, 6:25 PM