I need idea how to achieve something with BaconJS. I need to have something like this solution (it is just an example) but I want to call processBus only once after button is clicked. So I need to call
console.log((new Date()).getTime());
Only when the button is clicked and there is event into globalBus. Here is my code:
var globalBus = new Bacon.Bus();
var processBus = new Bacon.Bus();
function startProcess() {
globalBus.push(new Bacon.Next());
}
processBus.skipUntil(globalBus).onValue(function() {
console.log((new Date()).getTime());
});
setInterval(function() {
processBus.push(new Bacon.Next());
}, 1000);
and here is the example jsfiddle:
I mean only once but every time after button is clicked.
This is example of what I want to achieve but without BaconJS http://jsfiddle.net/Tjdp5/14/