You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, it is possible. The trick is to transform your highland stream into a Node Readable stream which automatically implements the Symbol.asyncIterable method.
conststream=require("highland");// Just an example to simulate async workfunctiondelay(ms){returnx=>stream(push=>{setTimeout(()=>{push(null,x);push(null,stream.nil);},ms);});}constsource=stream([1,2,3]).flatMap(delay(1000));(async()=>{forawait(letvalueofsource.toNodeStream({objectMode: true})){console.log(value);}})();
Hi! Is it possible to get an async iterable from a highland object? I'd like to be able to consume it with for-await-of if possible.
The text was updated successfully, but these errors were encountered: