Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is the advantage of using generators versus promises?


http://stackoverflow.com/a/28032438 gives a great overview to the pros and cons of both approaches.


In this case, Koa uses generators and promises together to emulate the behavior of async/await style concurrency. You can see how Babel 5.x transforms ES7 async/await into generators and promises at https://github.com/babel/babel/blob/v5.8.34/packages/babel/s...




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: