June 2016
Beginner to intermediate
292 pages
6h 8m
English
From the previous considerations, we can conclude that, despite their common usage, callback functions are not so suitable to manage asynchronous programming. They allow us to execute asynchronous code, but we have not a strong control on synchronization, error handling, and code readability.
In last years, an alternative pattern for managing asynchronous code is spreading in the JavaScript community—the Promise pattern.
Promises are objects that represent a value that we can handle at some point in the future. They can be used to capture the outcome of an asynchronous activity, such as an event, and to manage it in a consistent way. In fact, unlike event handling, using callbacks, Promises guarantees us to ...
Read now
Unlock full access