镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Suggestion: implement async / await #5

Description

Implement TypeScript support for the proposed ES7 functionality for async functions

See http://wiki.ecmascript.org/doku.php?id=strawman:async_functions

Activity

  1. jamesmanning commented on Jul 24, 2014

    @jamesmanning

    Just as a reference point for any others interested in async/await, experimental async/await support is available in traceur.

    See https://github.com/google/traceur-compiler/wiki/LanguageFeatures#async-functions-experimental

    It works well in my experience, and having it in TypeScript would make it a joy to use, in node especially. 😄

    I put up a simple repo that shows using async/await with traceur and node at https://github.com/jamesmanning/node-traceur-asyncawait

  2. Diullei commented on Jul 24, 2014

    @Diullei

    👍 👍 👍

  3. dthorpe commented on Aug 19, 2014

    @dthorpe

    👍

  4. leidegre commented on Sep 13, 2014

    @leidegre

    There was a lengthy discussion about this back in 2012 prominent also on the CodePlex site. One of the problems described there (by Mads Torgersen amongst others) was the lack of something to build it on top of. Like the Task abstraction in the .NET Framework.

    Promises to me looks awfully a lot like that and what the TypeScript compiler will have to support is the rewiring of the program flow to use promises (specifically there seems to be a spec called Promises/A+ (http://promisesaplus.com/) that is exactly this glue).

    I also find that there's a lesson here to be learned from the .NET Framework. For example, the AggregateException. Such a mechanism can be implemented in library alone and TypeScript does not have to offer a companion library for a feature which is largely source work.

    What I'm trying to get at is that the way that async/await changes how you write code for the better. I'd rather see a TypeScript implementation of async/await on top of promises today (that will at least run in Chrome) than wait another two or three years for ES7 async to be wide spread.

  5. eggers commented on Nov 12, 2014

    @eggers

    👍

  6. mhegazy commented on Jan 14, 2015

    @mhegazy
    Contributor

    A more detailed proposal available in #1664.

  7. added a commit that references this issue on Mar 31, 2015
  8. added a commit that references this issue on Feb 3, 2016
  9. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

SuggestionAn idea for TypeScript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions