I have the following function:
const _ = require('highland');
module.exports =
(numbers /* Readable */, words /* Readable */, repeated_words /* Writable */) => {
const numberStream = _(numbers);
const wordStream = _(words);
numberStream
.zip(wordStream)
.flatMap((numberWordPair) => {
const result = [];
for (let i = 0; i < numberWordPair[0]; i++) {
result.push(numberWordPair[1]);
}
return _(result);
})
.pipe(repeated_words);
};
The stream arguments are automatically injected and I am 100% sure the stream injection works (other streaming functions work).
When I replace this somewhat complex transformation by something as straightforward as _(numbers).each(xs => {console.log(xs)}), I can see the data being logged.
However, here, I must be clearly missing something with Highland.js as there is nothing produced at all.
I'm using version 2.13.5 of Highland.js.
What am I missing?
It appears it all works properly, therefore the mistake must lie somewhere else. As a proof, I was able to run this little program: