-
Notifications
You must be signed in to change notification settings - Fork 331
Home
Welcome to the bacon.js wiki.
I put some diagrams to illustrate how some of the more involved bacon.js methods work.
Merges events from both streams a
and b
into the result stream.
Result stream ends when both streams have ended.
Combines the latest values of property a
and stream or property b
using a given function. In this example, a self-explanatory plus
function is used.
First output event is generated when both a
and b
have produced a value. The combined stream ends when either of the inputs ends.
Like combine, but only outputs a new value on a new value to the b
stream.
Ends when b
ends. If no function is given, just outputs the values of a
.
Creates a new stream for each value in the source stream, using the given function f
. Merges the events from all created streams into the result stream.
Result stream ends when both the source stream and all the so-far created streams have ended.
Like flatMap
, switch creates new streams for each source event. Instead of merging all created streams, it "switches" between them so that when a new stream is created, the earlierly created stream is no longer listened to.
Result stream ends when source stream has ended and the latest created stream has ended.