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 · 387 阅读 · 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 · 293 阅读 · 0 评论