Sunday 23 December 2018

Question about while loops with async http.get

Newbie question. I'm requesting information from a url and running a while loop to put things on hold until it gets what's needed. I've found some hints online saying this doesn't work, but is someone able to explain it to me? Thanks!Note--taking shortcuts just to display my logiclet var1 let var2 let var3 get1 = http.get({ //update var1 in callback }) get2 = http.get({ //update var2 in callback }) get3 = http.get({ //update var3 in callback }) while (!(var1 && var2 && var3)){ // wait until we have them all } console.log("Got them all!")

Submitted December 24, 2018 at 12:48AM by IsotopicBear

No comments:

Post a Comment