Each time value above threshold arrives — start ti...
# rx
a
Each time value above threshold arrives — start timer: 1. if no new values arrive before timeout — emit alert 2. if new value arrives before timeout and
it > threshold
— switch to new timer and forget about previous timer 3. if new value arrives before timeout and
it < threshold
— switch to
Observable.never()
and forget about previous timer
switchMap
looks perfect for this case.