Closed sderosiaux closed 9 years ago
I'll let @raimohanska chime in with more details, but I also ran into this issue fairly early on as well.
One solution is to use Bacon.sequentially
rather than Bacon.fromArray
. fromArray
dumps all of the array contents into the first subscriber immediately, which means that any subscribers that you add after the first will not receive anything except the <end>
event. In your case log
is eating all of the stream events generated from fromArray
before filter
is called.
Yes it's the synch source thingie. Please don't use the 0.8 branch for anything serious yet. If you want to add logging without forcing a subscription, uou can use doAction.
All right, will do. Thanks!
Hi,
New to baconjs, I tried a simple example: filtering an array and printing out the even numbers, and log the values in-between (
log
returns the original stream, it does not have any side-effect right ? (except for the gc as the doc says)).Using latest release, 0.7.60 i get :
No value output, I guess it's related to the synchronous source
fromArray
(I saw some issues with that) -- which have been fixed in 0.8.Using 0.8 branch, i get:
Few things here :
Am I misunderstanding something or is there an issue somewhere (timing issue?) ?
Thanks