Nice writing. You could also add how to wait for more than one async call in parallel. With your implementation your are waiting for the first response and then for the next response and they could be done in parallel by using Promise.all. I know not so nice, but it should be faster.

Developer since the 80'th, working at Forschungszentrum Jülich (http://www.fz-juelich.de) …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store