Async/await in web browser or in node.js?

前端 未结 11 1750
执念已碎
执念已碎 2020-12-29 23:18

Is there any attempt to bring async/await feature from C# 5.0 to any language which can be compiled to JavaScript (such as CoffeScript)? (So it can be used

11条回答
  •  离开以前
    2020-12-30 00:08

    If you are interested in .NET style asynchronous programming for JavaScript you should look into Rx for JavaScript. Rx for JavaScrpt is Microsoft's JavaScript port of the Reactive Framework. The reactive framework is described as:

    A library to compose asynchronous and event-based programs using observable collections and LINQ-style query operators.

    You can download Rx for JavaScript here

    And you can read more about it, including examples here

    You can also install it on node with npm:

    npm install rx

    It works well with libraries like jQuery, however I am not a CoffeeScript programmer, so I'm not sure what support there is for interoperability with other JavaScript libraries in this language.

提交回复
热议问题