Closed nogo10 closed 8 years ago
The problem you have is that the stream you create with fromBinder
never ends. That means that the concatenated
stream never gets a value. You should add:
res.on('end', function() {
sink(new Bacon.End())
});
The unit test returns
"concatenated undefined"
Somehow the data is NOT getting through..
to check I ran the onValue()
The unit test returns:
Trace outputs sucessive lines each with new char until full line of data is logged:
"ipsum bla...bla"
Bacon.js can be a great buffer: Yes, I was missing
res.on('end', function() { sink(new Bacon.End()) });
and also
I was missing the return
in the statement
var concatenated = read.fold("", function(a,b) { return a+b;
});
Error output
It might be somewhat overkill but Im trying to use Bacon.js FRP to act as buffer/ stream processor for the http req response.. It works.. being able to log sequentially the characters. Problem is when I use proven Bacon.js fold() function to concat the resulting stream it logs a empty string..
Is the problem linked to learnyoumode testing framework? Is the testing framework capable of handling other buffer libs other than bl and concat?
My Code