Skip to content

Commit

Permalink
docs(egg-and-koa): modify invalid links (#3851)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd authored and atian25 committed Jul 29, 2019
1 parent 84894e8 commit 24c388b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/intro/egg-and-koa.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Egg and Koa
Node.js is an asynchronous world, asynchronous programming models in official API support are all in callback form ,it brings many problems. For example:

- [callback hell](http://callbackhell.com/): Notorious "callback hell"。
- [release zalgo](https://oren.github.io/blog/zalgo.html): Asynchronous functions may call callback function response data synchronously which would bring inconsistency.
- [release zalgo](https://oren.github.io/#/articles/zalgo/): Asynchronous functions may call callback function response data synchronously which would bring inconsistency.

The community has provided many solutions for the problems, the winner is Promise, it is built into ECMAScript 2015. On the basis of Promise, and with the ability of Generator to switch context, we can write asynchronous code in synchronous way with [co] and other third party libraries. Meanwhile [async function], the official solution has been published in ECMAScript 2017 and landed in Node.js 8.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/intro/egg-and-koa.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Egg.js 与 Koa
Node.js 是一个异步的世界,官方 API 支持的都是 callback 形式的异步编程模型,这会带来许多问题,例如

- [callback hell](http://callbackhell.com/): 最臭名昭著的 callback 嵌套问题。
- [release zalgo](https://oren.github.io/blog/zalgo.html): 异步函数中可能同步调用 callback 返回数据,带来不一致性。
- [release zalgo](https://oren.github.io/#/articles/zalgo/): 异步函数中可能同步调用 callback 返回数据,带来不一致性。

因此社区提供了各种异步的解决方案,最终胜出的是 Promise,它也内置到了 ECMAScript 2015 中。而在 Promise 的基础上,结合 Generator 提供的切换上下文能力,出现了 [co] 等第三方类库来让我们用同步写法编写异步代码。同时,[async function] 这个官方解决方案也于 ECMAScript 2017 中发布,并在 Node.js 8 中实现。

Expand Down

0 comments on commit 24c388b

Please sign in to comment.