Not pretty. This is also known as the “pyramid of doom” (and we haven’t even added error handlers yet).
How to write beautiful Node.js APIs using async/await and the Firebase Database
Paul Breslin
1.5K10

Update: it was pointed out by benjick on Reddit that it’s possible to flatten promise chains. See here for more info. Thanks for the feedback!

Like what you read? Give Paul Breslin a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.