Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SakuraMuxia committed May 9, 2024
1 parent 788570d commit ec71a96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/front-end/04-ES6/17-promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,5 +650,5 @@ async 与 await 实现链式调用
- (1) JS 引擎首先必须先执行所有的初始化同步任务代码。
- (2) 每次准备取出第一个宏任务执行前, 都要将所有的微任务一个一个取出来执行。

![image-20240506142439784](000-images/17-promise/image-20240506142439784.png)
![image-20240506142439784](https://2216847528.oss-cn-beijing.aliyuncs.com/asset/image-20240506142439784.png)

8 changes: 4 additions & 4 deletions docs/front-end/04-ES6/18-promise自定义.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,19 @@ const p1 = new Promise((resolve, reject) => {

执行器函数 传给class类中的构造器exector作为形参

![image-20240506170947017](000-images/18-promise自定义/image-20240506170947017.png)
![image-20240506170947017](https://2216847528.oss-cn-beijing.aliyuncs.com/asset/image-20240506170947017.png)

**传入调用过程2**

构造器函数调用 传来的执行器函数,并且使用两个函数作为参数,(一个成功的函数,一个失败的函数)

![image-20240506171354717](000-images/18-promise自定义/image-20240506171354717.png)
![image-20240506171354717](https://2216847528.oss-cn-beijing.aliyuncs.com/asset/image-20240506171354717.png)

**传入调用过程3**

执行器函数 调用成功的函数设置成功状态

![image-20240506173012063](000-images/18-promise自定义/image-20240506173012063.png)
![image-20240506173012063](https://2216847528.oss-cn-beijing.aliyuncs.com/asset/image-20240506173012063.png)



Expand Down Expand Up @@ -954,7 +954,7 @@ then方法链式调用过程。
then方法返回一个新的Promise对象,新对象在实例化中执行器
![image-20240507105406241](000-images/18-promise自定义/image-20240507105406241.png)
![image-20240507105406241](https://2216847528.oss-cn-beijing.aliyuncs.com/asset/image-20240507105406241.png)
## 9 实现 then 方法: 进一步封装
Expand Down

0 comments on commit ec71a96

Please sign in to comment.