DEV Community

Discussion on: ⭐️🎀 JavaScript Visualized: Promises & Async/Await

Collapse
 
pke profile image
Philipp Kursawe • Edited

Thanks for the writeup!

There is slight room for improvement though I think to just hand in the then handler functions, which in turn receive the correct input automatically that way:

getImage("./image")
  .then(compressImage)
  .then(applyFilter)
  .then(saveImage)
  .then(res => console.log("Success"))
  .catch(error => console.error(error))
Enter fullscreen mode Exit fullscreen mode