Typescript: Why there is no document about Generator?

Created on 18 Oct 2016  路  7Comments  路  Source: microsoft/TypeScript

I wanted to read about Generator in detail on Typescript offical website; however, I couldn't find even any small explanation in the official document. I strongly believe that Typescript has adopted the feature since Typescript 1.6. But no good info for beginners.
this is all and no info even though generator is one of the important features in ECMAScript6.
https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html

Of course, there is a few decent docs in terms of ECMAScript 6 Generator outside, but not Typescript
Could you tell me where I can find some decent Generator document for beginners to use properly ?

Docs

Most helpful comment

@chicoxyzzy I know, but I consider the official doc is supposed to give an explanation for beginners.
As you can see, there is no info at all. I am pointing that and I am insisting that people in Typescript group should guide it for beginners. How about let's put this explanation "TS generators and ES generators are the same thing so ES6 generators docs are good for start. in the official doc" maybe it woud be even better. Thanks anyway

All 7 comments

TS generators and ES generators are the same thing so ES6 generators docs are good enough for start.

@chicoxyzzy I know, but I consider the official doc is supposed to give an explanation for beginners.
As you can see, there is no info at all. I am pointing that and I am insisting that people in Typescript group should guide it for beginners. How about let's put this explanation "TS generators and ES generators are the same thing so ES6 generators docs are good for start. in the official doc" maybe it woud be even better. Thanks anyway

Worse than that - it would appear generators are not supported as they are not mentioned - despite being in the title!

Further confusion caused by http://kangax.github.io/compat-table/es6/#test-generators not having a column for TypeScript itself. The one it has for TS 1.8 says generators are not supported.

I mean, we don't document for loops either, but we do support them 馃槢

OK fair point :) Though generators are a new feature not an old fundamental so you might not support them. You don't have a table of es5 / es6 etc features as they are implemented

But do please remove form the chapter title if they are not included in the body.

It is important to understand the limitations in the transpilation of generators down to ES5 and ES3 - that is why they need documentation.

Was this page helpful?
0 / 5 - 0 ratings