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 either in web browser or in node.js.)
Async is on feature list for JavaScript harmony. So far there are numerous attempts to provide such functionality in the browser or in node, none of them seem to be compatible with harmony proposal though:
async/await looks to be coming in ECMAScript 7. This proposal was accepted into stage 1 of the specification process in January 2014.
The good news is that Googles traceur compiler already supports it, so you could start using it today.
Sample syntax:
async function asyncValue(value) { await timeout(50); return value; }
async/await is also on the TypeScript roadmap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With