es.shim/lib/cjs/promise.js

16 lines
282 B
JavaScript
Raw Normal View History

/**
2020-09-18 10:32:10 +08:00
* @author yutent<yutent.io@gmail.com>
* @date 2020/09/16 12:09:06
*/
if (!Promise.defer) {
Promise.defer = function() {
let obj = {}
obj.promise = new Promise((resolve, reject) => {
obj.resolve = resolve
obj.reject = reject
})
return obj
}
}