I have hot observed power from the socket. I can use pausable to pause the socket. But as soon as I “canceled” the observable, I need to display the last values that the socket could send when the subscription was suspended. I don't want to keep track of the latest values that the socket sends manually ... How could this be believable?
In the example documentation below, see the comments below:
var pauser = new Rx.Subject();
var source = Rx.Observable.fromEvent(document, 'mousemove').pausable(pauser);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x.toString());
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
pauser.onNext(true);
pauser.onNext(false);
Thibs source
share