Typescript Generator Property / Getter

Viewed 1449

Making a generator method in typescript is simple:

class Foo {
    *values() { yield 10 }
}

But I want to make a generator property, something like this:

class Foo {
    get *values() { yield 10 }
}

But that seems to be invalid. I can't seem to find any references to this question or workarounds (aside from the obvious of using Object.defineProperty explicitly, which would suck because it would be untyped). Am I missing something? Is this supported? If not, will it be?

1 Answers
Related