What will be the performant solution for this problem where I want to make some async calls, wait in last until all the calls are completed, then return the result.
function parseAndMatch(arg1, arg2){
async.all([
asyncCall1(arg1, arg2),
asyncCall2(arg1, arg2)]
).then( result => {
//do something with result;
return finalResult;
});
}
I tried to fit npm deasync
, asyncawait
, bluebird
, and async
packages to solve this problem. But I couldn't find the solution.