mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-29 05:42:20 +00:00
docs(promise): delete async
This commit is contained in:
parent
b426312fa6
commit
cc6a82dcc3
@ -769,9 +769,3 @@ run(g);
|
||||
|
||||
上面代码的Generator函数`g`之中,有一个异步操作`getFoo`,它返回的就是一个`Promise`对象。函数`run`用来处理这个`Promise`对象,并调用下一个`next`方法。
|
||||
|
||||
## async函数
|
||||
|
||||
async函数与Promise、Generator函数一样,是用来取代回调函数、解决异步操作的一种方法。它本质上是Generator函数的语法糖。async函数并不属于ES6,而是被列入了ES7,但是traceur、Babel.js、regenerator等转码器已经支持这个功能,转码后立刻就能使用。
|
||||
|
||||
async函数的详细介绍,请看《异步操作》一章。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user