yortus / asyncawait

Callback heaven for Node.js with async/await
MIT License
1.91k stars 77 forks source link

Using a for loop #62

Closed samcov closed 7 years ago

samcov commented 7 years ago

I didn't see any examples using a for loop. Is it as simple as wrapping the for loop as below,

var foo = async (function() {
    for(var i=0; i < 10; i++)
    {
         var v= await (doSomething(30));
    }
});
yortus commented 7 years ago

@samcov yes, that looks right.

samcov commented 7 years ago

Thanks, we need this on older Node versions that we can't upgrade.