- Modern JavaScript Web Development Cookbook
- Federico Kereki
- 67字
- 2021-07-02 14:49:56
Doing async calls compactly
When Ajax started appearing, it was commonly used with callbacks, which themselves could have callbacks of their own, with more callbacks within, which eventually led to coining the term callback hell. As a way out of that impractical programming style, two other styles of working with services and asynchronous calls appeared: promises and async/await—though in truth, the latter also use promises!