Closed zenparsing closed 10 years ago
We use [Symbol.iterator] for the hook. Essentially, we are expanding the interface for Iterable. Each of the generator functions (next
, return
, and throw
) are defined as returning either IteratorResult
or Promise<IteratorResult>
.
What should the hook for async iteration be?
Analyze the tradeoffs for each option.