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

Make .iterator() implement return() correctly #20

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

raymondfeng
Copy link
Contributor

Please note the current implementation of return() breaks the AsyncIterator interface. It should return a promise.

interface AsyncIterator<T> {
    next(value?: any): Promise<IteratorResult<T>>;
    return?(value?: any): Promise<IteratorResult<T>>;
    throw?(e?: any): Promise<IteratorResult<T>>;
}

@raymondfeng
Copy link
Contributor Author

@sindresorhus @szmarczak One more thing to review. Thanks!

@sindresorhus sindresorhus changed the title fix: make sure iterator implements return() correctly Make .iterator() implement return() correctly Feb 11, 2019
@sindresorhus sindresorhus merged commit 68d745a into sindresorhus:master Feb 11, 2019
@raymondfeng
Copy link
Contributor Author

@sindresorhus Thank you for the prompt merge. Would you please publish a new release soon?

@sindresorhus
Copy link
Owner

Yes, when #16 is done.

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.

2 participants