Async Arrow Functions (for easy parent context access)

JS
S
JavaScript

Syntactic sugar for using async await with arrow functions.

1const foo = async () => {
2  // do something
3}
4
5// anonymous
6const foo = async function() {
7  // do something
8}
9
10// declaration
11async function foo() {
12  // do something
13}
14
15// callback
16const foo = event.onCall(async () => {
17  // do something
18})

Created on 1/4/2019