Skip to content
New issue

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

Move API to be compatible with AsyncIterable spec #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmorrell
Copy link

This updates the API to implement the AsyncIterable interface. It's a bit of a step back in terms of usability now, but conforms better to where the language is going. A standard interface will work better with third party libraries and the eventual changes to the language.

Eventually we'd like to be able to do this:

for await (const url of itemize(...)) {
  console.log(url)
}

Spec: https://github.com/tc39/proposal-async-iteration
Informational blog post: http://2ality.com/2016/10/asynchronous-iteration.html

@jmorrell
Copy link
Author

Idea: replace current next method with nextUrl or nextItem to keep the aesthetic API for now, but still have a spec-conforming next method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant