repeaterjs / repeater

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

return vs throw #73

Closed yaacovCR closed 2 years ago

yaacovCR commented 2 years ago

Related #72

This is just a short demo showing the difference between return vs throw that causes throw to hang with even simple repeaters when a pending push has not been reached, having nothing actually to do with mapping async iterators/generators/etc.

@brainkim

I assume this is per spec, and the tests in graphql-js make optimistic? unfair? non-generator-like? assumptions.

@IvanGoncharov

yaacovCR commented 2 years ago

And by per spec, I mean in line with async generators. Graphql JS now returns iterators that conform to the generator type signature, perhaps they should also follow their internal behavior.

closing, as nothing actionable