Note: In my current project, I am utilizing TypeScript along with RxJS version 2.5.3.
My objective is to track idle click times on a screen for a duration of 5 seconds.
var noClickStream = Rx.Observable.fromEvent<MouseEvent>($window.document, 'click')
.bufferWithTime(5000)
.filter(eventBundle => {
return eventBundle.length === 0;
});
This code successfully executes. The subscriber is triggered when there are no clicks within the specified time frame.
Now, I want the ability to pause and resume the noClickStream inside the subscribe function when displaying a warning screen. To achieve this, I included the pausable() method to the original no click stream.
var noClickStream = Rx.Observable.fromEvent<MouseEvent>($window.document, 'click')
.bufferWithTime(5000)
.filter(eventBundle => {
return eventBundle.length === 0;
})
.pausable();
However, after implementing the pause functionality, the noClickStreamSubscriber function does not get invoked even if there are no clicks for 5 seconds. Is it possible that fromEvent does not support the pausable feature?