Pablo
05/06/2021, 2:08 PMscope.launch{
var foo = true
while(foo){
delay(1_000)
//do some actions here
//with these actions I check if the time is correct and if goes inside the if i put the foo to false so it leaves the while
if(whatever) {
foo=false
//call one method here
}
}
}
Is this a correct way? Is there a better way with flow?Derek Ellis
05/06/2021, 2:25 PMflow {
while (true) {
emit(someValue)
delay(1000)
}
}.takeWhile { whatever }
Pablo
05/06/2021, 2:26 PMgildor
05/06/2021, 2:37 PMwhile
?Pablo
05/06/2021, 2:38 PMgildor
05/06/2021, 2:40 PMuli
05/07/2021, 6:10 AM