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

Fix "for...of" loop on Result<T> objects #423

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

Conversation

ramikg
Copy link

@ramikg ramikg commented May 30, 2024

Trying to iterate over a Result<T> object (e.g. one returned by calling find) using a "for...of" loop results in the following TypeScript error:

TS2488: Type Result must have a [Symbol.iterator]() method that returns an iterator.

But, Result<T> explicitly implements [Symbol.iterator], so ignoring this type error fixes the "for...of" iteration.

This PR adds the missing method to the type definition.

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