Op donderdag 4 december 2014 16:35:48 UTC+1 schreef raimohanska:
Thanks for the reply!
I use Bacon.JS for my implementation of a Flow-Based Programming system.
I use the ZipAsArray function to ensure that a component with multiple IN-ports only starts processing once every IN-port has data available.
Consider this simple graph made in my editor:
http://oi59.tinypic.com/200u4as.jpg
Connections (purple) are implemented using Bacon.Bus.
The "ADD" component simply adds the 2 values which it receives. But in order to execute, it must ensure that there is data available on both ports. This is done using ZipAsArray.
If i would disconnect one of the 'Counter -> Add' connections, the Add component will halt its execution (as intended).
If i use combineAsArray instead, the Add component keeps processing, since it just keeps using the latest value that was send over the now disconnected stream.
There is probably a workaround for this too, or it may just be my lack of understanding of other functions. Anyway zipAsArray does the job just fine.