Authors: Sergey Rubanov
Champion: Hemanth HM, Brendan Eich (?)
Stage: Stage 1 of the TC39 process.
Experience so far has been that people love arrow functions and generators and want a generator arrow. — Brendan Eich
Both arrow functions and generators are available since ES2015. Often people want to use generator arrow and this proposal (which was raised years ago) should solve their needs.
- 3 years old React example
- need more use-cases
Discussion of future syntax: #2
// Irregular
() =*> ...
// not the same order as in regular generator functions
() =>* ...
// also wrong order
() *=> ...
// ASI hazard
*() => ...
generator function() {}
const foo = async generator function() {};
class Foo {
x = 1
// No more ASI hazard!
generator foo() {}
}
- https://esdiscuss.org/topic/why-do-generator-expressions-return-generators
- https://esdiscuss.org/topic/generator-arrow-functions
- none yet