
API
红99
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
手撕Promise之从0开始实现完整的Promise的对象-all/race函数实现
var MyPromise = function (fn) { // 更新状态和值 this.PromiseState = 'pending' this.PromiseResult = undefined // 定义then的回调函数 this.thenCallback = undefined; // 定义catch的回调函数 this.catchCallback = undefined; var _this = this; var resolve = function原创 2022-02-24 15:46:21 · 442 阅读 · 0 评论 -
手撕Promise之从0开始实现完整的Promise的对象-catch函数实现
var MyPromise = function (fn) { // 更新状态和值 this.PromiseState = 'pending' this.PromiseResult = undefined // 定义then的回调函数 this.thenCallback = undefined; // 定义catch的回调函数 this.catchCallback = undefined; var _this = this; var resolve = functio原创 2022-02-24 15:08:54 · 336 阅读 · 0 评论