I\'m capturing events from an application using Rx.Observable.fromEvent
in a NodeJS.
These are sent to another server using request (https://www.npmjs.com/pack
A proposed implementation, using the delay
operator :
function emits(who){
return function (x) { console.log([who, "emits"].join(" ") + " " + x + " click(s)");};
}
var source = Rx.Observable.fromEvent(document.body, 'click');
console.log("running");
var delayedSource$ = source.delay(1200);
var buffered$ = source
.buffer(function () { return delayedSource$;}).map(function(clickBuffer){return clickBuffer.length;})
buffered$.subscribe(emits("buffer"));
jsbin here : http://jsbin.com/wilurivehu/edit?html,js,console,output