"concat"-ing two streams with Bacon.js

46 views
Skip to first unread message

Shameer C

unread,
Dec 3, 2014, 6:12:06 AM12/3/14
to bac...@googlegroups.com
Hi,

I'm trying to get my head around with FRP, using Bacon.js. When I try to concat a stream with another, I can see only the events from the first, but nothing from the second. 
For example (as I understand it)

streamA : a - - - b - - - - c - - - - d
streamB : e - - f - - - g
streamB.concat(streamA) should be: e - - f - - - g c - - - - d
But what I'm getting is : e - - f - - - g  only

I just want to know if this is the correct behaviour or am I missing something?

Thanks
Shameer

Ted Suzman

unread,
Dec 3, 2014, 6:29:29 AM12/3/14
to Shameer C, bac...@googlegroups.com
this might be more what you want --
http://jsbin.com/mowozoteku/3/edit?js,console

it looks like `a.concat(b)` only starts pushing through events from `b`  once `a` has ended. in the jsbin, I changed `Bacon.End()` to `observer(new Bacon.End()` -- that way, the stream will end.

--
You received this message because you are subscribed to the Google Groups "Bacon.js" group.
To post to this group, send email to bac...@googlegroups.com.
Visit this group at http://groups.google.com/group/baconjs.

Shameer C

unread,
Dec 3, 2014, 12:04:02 PM12/3/14
to bac...@googlegroups.com, shame...@gmail.com
Hi Ted,

Thanks for your reply. It is working as expected :)

Regards
Shameer
Reply all
Reply to author
Forward
0 new messages