doc: add analogy section

This commit is contained in:
Leon Xu committed 2021-10-01 20:38:32 -07:00
1 parent 4b0067499d
commit d34264ca2f
1 file changed
+19
+19
View File
@@ -76,3 +76,22 @@ setTimeout(() => {
... ...
}, 2000); }, 2000);
``` ```
# 比如:你出去吃披萨
在餐馆,你遵循以下步骤:
- 请求菜单
- 订一个披萨
- 检查披萨
- 吃披萨
- 支付披萨
在前一步完成之前,每一步都不能继续。
```javascript
requestMenu();
// twiddle thumbs
orderPizza();
// twiddle thumbs
verifyPizza();
// twiddle thumbs
eatPizza();
// twiddle thumbs
payForPizza();
```