手写promise
用类的方法来写promise声明HD.jsclass HD{//三种状态,pending->fulfilled,pending->rejected//过度->成功,过渡->失败 static PENDING='pending' static FULFILLED='fulfilled' static REJECTED='rejected' //构造函数,状态和传的值,以及改变状态的执行器 constructor(executor){ this.sta
原创
2021-04-03 22:16:19 ·
246 阅读 ·
0 评论