Closed Macil closed 9 years ago
Once again, a problem caused by synchronously responding sources, as in #367.
The Bacon.once()
stream responds synchroneously, and the onValue
function gets served before takeUntil
has subscribed to the Bus
.
Fixed in 0.7.57. There was indeed "one more thing" to fix in the workings of bus.end()
when called without subscribers.
This code should print "got value 1" and stop, but instead "got value 1" and "got value 2" are outputted. However, if you add a subscriber to the bus first by adding
bus.log();
after defining the bus, it works as expected.Calling
bus.end()
before there are any subscribers usually does nothing (I'm a little uncomfortable with this, but it's not what this issue is specifically). However, the.takeUntil(bus.mapEnd(null))
does add a subscriber to the bus, so I'd expect the laterbus.end()
call to work.Bacon 0.7.41 from NPM