Well Bacon is still one big surprise for me...
bus = new Bacon.Bus()
busProperty = bus.toProperty()
bus.push 'someValue'
busProperty.onValue (val) ->
console.log val
This way, nothing is logged to console at all. I am probably looking from the wrong angle, but I would be expecting, that Property provides whatever was the latest value. Apparently, it's not that easy...
busProperty.log()
bus.push 'someValue'
busProperty.onValue (val) ->
console.log val
Suddenly I am getting 'someValue' logged twice. That means the Property doesn't care about stream values until there is consumer ? Is it possible to overcome this somehow ? It seems rather silly that I would need to attach empty consumer just for the kicks of storing value into Property.
This is part of my app design, that stream receives value before any consumers are attached. However I do care about that value from the past. Essentially I am looking for synchronous version of Promise/A :)