jeudi 5 mars 2015

How to fire multiple async calls in koa using generators+promises

I'm new to generators and having a hard time finding an example of how to fire off multiple async calls with generators + native promises


so far I have in a sudo code format



function *getData (){
var data = yeild makeAPICall ();
}

function makeAPICall (){
async code
return async code
}


How would I structure my code if I wanted to make multiple calls to makeAPICall in parallel using native javascript promises.


Aucun commentaire:

Enregistrer un commentaire