实现一个简单的Promise
function promiseTest () {
this.status = 'pending' // 2.1
this.msg = '' // 存储value与reason 成功或者失败的返回值
let process = arguments[0],
that = this
process (function () {
that.status = 'resolve'
that.msg = arguments[0]
}, function () {
that
原创
2021-06-27 17:51:21 ·
109 阅读 ·
0 评论