koufa
01/23/2020, 2:56 PMdekans
01/23/2020, 2:57 PMfun foo(): Flow<Int> = flow {
for (i in 1..3) {
delay(100)
emit(i)
}
}
koufa
01/23/2020, 3:02 PMinterval
from Rx. But it is astonishingly easy to create that yourself with flow so probably they keep the API smallbdawg.io
01/24/2020, 12:41 AMSequence
to generate the numbers and convert it to a flow that's delayed
generateSequence(0) { it + 1 }
.asFlow()
.delayEach(100)
...
(1..3).asFlow().delayEach(100)
It ends up coming down to syntax preference and what makes sense for your use case though :)Jason
01/24/2020, 2:01 AMemitByPeriod()
or something like that ?