Gazebo_simulation-Frontend/node_modules/@redux-saga/deferred/dist/redux-saga-deferred.esm.js

21 lines
359 B
JavaScript
Raw Normal View History

2020-12-21 11:29:31 -04:00
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 };