We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to write haxe code eq
for await (const msg of source) {
// exact matching node2.handle('/your-protocol', ({ stream }) => { pipe( stream, async function (source) { for await (const msg of source) { console.log(msg.toString()) } } ) })
how to support AsyncGenerator?
node.handle('/your-protocol', (d) -> { ItPipe.pipe(d.stream, JSAsync.jsasync(function(source:Array<Promise<Any>>) { //don't know how to write here? })); });
The text was updated successfully, but these errors were encountered:
hx-jsasync doesn't currently support for await. It might be a good feature to include in the future.
In your example code the source argument of your function is an Array and not an async iterator/generator. If so you can simply do:
for (v in source) { Browser.console.log(msg.jsawait()); }
However, if your source is an async iterator you'll need to write the loop manually:
while(true) { var v = source.next().jsawait(); if ( v.done ) break; Browser.console.log(v.value) }
Sorry, something went wrong.
thank you @basro , shall we keep open this until you add a new feature about for await of
for await of
Sure
No branches or pull requests
how to write haxe code eq
how to support AsyncGenerator?
The text was updated successfully, but these errors were encountered: