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
Occasionally an API requires the use of a JavaScript async for over some iterator like this:
for
for await (const [key, value] of this.keyv.iterator()) { console.log(key, value); // Return: key and value };
It would be neat if there was a way to do this directly in promesa, similar to the macro at How to work with asynciterable. Here's the macro:
(defmacro async-doseq [[binding async-iterable] & body] `(let [async-iterator# ((js* "~{}[Symbol.asyncIterator]" ~async-iterable))] (fn handle-next# [] (let [next# (.next async-iterator#)] (.then next# (fn [res#] (if (.- res# done) nil (do (let [~binding (.- res# value)] ~@body) (handle-next#)))))))))
Is this something Promesa is interested in supporting?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Occasionally an API requires the use of a JavaScript async
for
over some iterator like this:It would be neat if there was a way to do this directly in promesa, similar to the macro at How to work with asynciterable. Here's the macro:
Is this something Promesa is interested in supporting?
The text was updated successfully, but these errors were encountered: