I'm using `Observable.interval` to count down from...
# rx
a
I'm using
Observable.interval
to count down from 30 seconds to zero. After that, I want to use
flatMap
and continue another Rx chain. I'm not sure what the best way is to actually know when
after that
is. Using
flatMap
directly after the
interval
call obviously doesn't work since the
flatMap
gets called after each tick of the interval. RIght now I'm using
materialize
and checking if the notification
isOnComplete
. Is that the best way to handle this?
l
Maybe you’re looking for
timer
instead?
p
if you want to accumulate a value
scan
might help too.
a
It looks like
Timer
only emits once the timer finishes, which is not what I want since I'm using the values that
interval
produces.
scan
seems unnecessary in conjunction with
interval
...I could theoretically use both
interval
and
timer
in two different chains to accomplish this
r
Maybe
concatWith()
?
☝️ 1
a
Oh that's perfect
CLASSIC RUSSELL!
😛 1