I have a timer:
initiateTimer() {
if (this.timerSub)
this.destroyTimer();
let timer = TimerObservable.create(0, 1000);
this.timerSub = timer.subscribe(t => {
this.secondTicks = t
});
}
How would I add the condition to after 60 minutes present a popup to the user? I've tried looking at a couple of questions (this and this) but it's not clicking for me. Still new to RxJS patterns...
Just use
observable.timer
and subscribe to it.Please see more details
I ended up doing this from what I initially had which gives me what I need:
I implemented this before I tried what I marked as answer, so will just leave it here.
You don't need RxJS for that. You can use good old
setTimeout
:If you really must use RxJS, you could: