Hi!!..I'm newbie with baconjs..so probably you will find me here frecuently asking question :D ...I've a few questions
1) My first impression about properties was then they are similar to reactive variables...something like this concept
so..for instance...if I have
var trueOrFalseProperty = ....
var streamOfNumbers = .....
if I only wish sum the values of streamOfNumbers when trueOrFalseProperty is true then I could do something lik
streamOfNumbers.scan(0,function(mem,_){
return (trueOrFalseProperty==true ? mem+1 : mem)
})
but wait, trueOrFalseProperty is not the value, instead is a container (is a stream too?) with the bool value inside..then my approach was something like this
var counter = update.scan(0,function (mem, _) {
trueOrFalsePropert.flatMap(function (_bool) { //I try map too
console.dir(_bool); //this never run
return (_bool == "true" ? : mem+1 : mem)
})
}).log();
this doesn't works, even doesn't run...
2) I wish know what could be the best approach for archieve this sample..where I don't need listen the change in a property but I need access to it in a future, based in other stream...
thanks and sorry for the noob question or any mistake in my code, I can't access to the original code than I wrote and I did this following as I remembered it...
thanks again :D.....