I wonder what is the correct way to handle async call within if condition. For example I want to fix the following code.
if(criterium2){
function1(value, function(error, result){
})
}
else {
function2(value, function(error, result){
})
}
What is the best way to handle async call within if.
Aucun commentaire:
Enregistrer un commentaire