Async arrow functions look like this:
(异步箭头函数如下所示:)
const foo = async () => {
// do something
}
Async arrow functions look like this for a single argument passed to it:
(传递给它的单个参数的异步箭头函数如下所示:)
const foo = async evt => {
// do something with evt
}
The anonymous form works as well:
(匿名形式也可以使用:)
const foo = async function() {
// do something
}
An async function declaration looks like this:
(异步函数声明如下所示:)
async function foo() {
// do something
}
Using async function in a callback :
(在回调中使用异步函数:)
const foo = event.onCall(async () => {
// do something
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…