8 lines
220 B
JavaScript
8 lines
220 B
JavaScript
Promise.withResolvers || (Promise.withResolvers = function withResolvers() {
|
|
var a, b, c = new this(function (resolve, reject) {
|
|
a = resolve;
|
|
b = reject;
|
|
});
|
|
return {resolve: a, reject: b, promise: c};
|
|
});
|