Skip to content

Comment on ES6 in Depth: Destructuring

Comments

Adding to babel and traceur, Typescript is catching up with all ES6 features, so you can use destructors (discussed [here](https://github.com/Microsoft/TypeScript/issues/240)) in Typescript v1.5--beta

You shouldn't use the term "destructor" as an alias of "destructuring expressions" - destructors are an entirely different thing[1], which is not applicable to JS.

[1] http://en.wikipedia.org/wiki/Destructor_%28computer_programm...

Does typeScript support generator syntax and a Promise shim yet? What about generators? These are pretty much required to get to async/await goodness.

I ask because I am genuinely interested, and haven't looked into it for a while, only passively in the context of Angular 2. The addition of attributes (@ tagging) is specifically interesting to me as I think it's a cleaner syntax visually than mounting methods onto a function after declaration.

With BabelJS, I can use flow to get type annotations, but not sure about meta annotations (like attribute declarations in .net)

Both async/await and generators are on the roadmap[0] for the next version.

[0] https://github.com/Microsoft/TypeScript/wiki/Roadmap

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.