File: async_functions.md

package info (click to toggle)
coffeescript 2.7.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,376 kB
  • sloc: makefile: 20; xml: 9; javascript: 5; sh: 1
file content (9 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
## Async Functions

ES2017’s [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) are supported through the `await` keyword. Like with generators, there's no need for an `async` keyword; an async function in CoffeeScript is simply a function that awaits.

Similar to how `yield return` forces a generator, `await return` may be used to force a function to be async.

```
codeFor('async', true)
```