I need run a function if neither the mouse has moved, nor the keyboard has been touched for 1mn.
I tried the code below but doesn't seem to work. How can I fix it? Thank you for your help.
mouseEvent$ = fromEvent(document, 'mouseMove');
keyPress$ = fromEvent(document, 'keyup');
merge(
this.mouseEvent$.pipe(startWith(null)).pipe(switchMap(() => timer(10000, 1000))),
this.keyPress$.pipe(startWith(null)).pipe(switchMap(() => timer(10000, 1000))),
).subscribe(() => console.log("----));