Open theydy opened 3 years ago
const mergePromise = function(args) {
const list = args.slice();
const result = [];
let target;
return new Promise(async (resolve) => {
while((target = list.shift(), target)){
const res = await target();
result.push(res);
}
resolve(result);
});
}