Closed tiswrt closed 3 years ago
Right - that's a bit of bad API work on our side, but it's been like that for ages sadly. :(
The docs for scramjet.Multistream..map say that it returns a promise... means that either you should do:
new MultiStream([stream1, stream2])
.smap(stream => stream.filter(n => n % 2))
.mux();
Or if you want to do something asynchronous:
// somewhere in an async function
await (
new MultiStream([stream1, stream2])
.map(stream => stream.filter(n => n % 2))
)
.mux();
This trully despicable behaviour should be made up for in the upcoming scramjet 5 (although interface v4 will still be supported via a compatibility layer - so no worries).
Please let me know if this solves your issue.
It does, thanks a lot!
MultiStream.map(...).mux is not a function if you try the example from the docs for MultiStreams
Throws this error:
Node v15.7.0, Scramjet v4.35.11