Hacker News new | past | comments | ask | show | jobs | submit login

I believe promise.each is not serial in the way you think it is. Promises do handle only the resolution of certain events. So in your example both statements are executed exactly at the time you set up your array of promises. Promises.each then only ensures that their promise handlers are executed in sequence.

So instead of promises you could create an array of arrow functions and with promise.each execute one after the other.




I've come up with a similar implementation, I will credit you for inspiring a working solution in my article! Thank you very much!




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

Search: