repeaterjs / repeater

The missing constructor for creating safe async iterators
https://repeater.js.org
MIT License
459 stars 12 forks source link

Repeater.prototype.return should accept a PromiseLike<TReturn> #36

Closed brainkim closed 4 years ago

brainkim commented 4 years ago

The return method should accept a thenable which resolves to the final value as well as a final value (see spec). The typescript AsyncIterator interface requires return to be passed PromiseLike<TReturn> | TReturn. We should handle the case where a PromiseLike is passed to return in code and update types.