amis-rpc-design/node_modules/@redux-saga/deferred/dist/redux-saga-deferred.esm.js
2023-10-07 19:42:30 +08:00

21 lines
359 B
JavaScript

function deferred() {
var def = {};
def.promise = new Promise(function (resolve, reject) {
def.resolve = resolve;
def.reject = reject;
});
return def;
}
function arrayOfDeferred(length) {
var arr = [];
for (var i = 0; i < length; i++) {
arr.push(deferred());
}
return arr;
}
export default deferred;
export { arrayOfDeferred };