-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: remove async-function #1713
Conversation
@@ -177,6 +179,7 @@ const { news, user } = await app.toPromise(ctx.service.biz.list(topic, uid)); | |||
- [toAsyncFunction][app.toAsyncFunction] 和 [toPromise][app.toPromise] 实际使用的是 [co] 包装,因此会带回对应的性能损失和堆栈问题,建议开发者还是尽量全链路升级。 | |||
- [toAsyncFunction][app.toAsyncFunction] 在调用 async function 时不会有损失。 | |||
|
|||
@sindresorhus 编写了许多[基于 promise 的 helper 方法](https://github.com/sindresorhus/promise-fun),灵活的运用它们配合 async function 能让代码更加具有可读性。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async 那篇一些内容移到这边来了
|
||
- 底层基于 Koa 1.x,异步解决方案基于 [co] 封装的 generator function。 | ||
- 官方插件以及 Egg 核心使用 generator function 编写,保持对 Node.js LTS 版本的支持,在必要处通过 co 包装以兼容在 async function 中的使用。 | ||
- 应用开发者可以选择 async function(Node.js 7.6+) 或者 generator function(Node.js 6.0+)进行编写,**我们推荐 generator function 方案以确保应用可以运行在 Node.js LTS 版本上**。 | ||
- 应用开发者可以选择 async function(Node.js 7.6+) 或者 generator function(Node.js 6.0+)进行编写。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 8 吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有英文的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
有个链接挂了 |
fixed |
fdeea3b
to
8189a2b
Compare
合了? |
docs: remove async-function (#1713)
Checklist
npm test
passesAffected core subsystem(s)
Description of change