Learning JavaScript Promises: Practical Applications in ES6 and AngularJS

Watch Learning JavaScript Promises: Practical Applications in ES6 and AngularJS

  • 2015
  • 1 Season

Learning JavaScript Promises: Practical Applications in ES6 and AngularJS from Packt Publishing is a comprehensive video course that is designed to teach you how to use JavaScript Promises in practical applications. In this course, Mathieu Chauvinc, an experienced software developer and educator, will walk you through the fundamentals of JavaScript Promises and how they can be used to effectively manage asynchronous operations in your code.

The course is structured into six chapters, starting with an introduction to Promises and how they differ from traditional callbacks. You will learn about the different states of a Promise and how to handle errors and exceptions using .catch(). Mathieu will also teach you how to work with Promises in parallel and in sequence, and demonstrate how to use Promise.all() and Promise.race() to handle multiple asynchronous operations.

In chapter two, Mathieu will teach you about Promise chaining and how it can help to simplify your code. You will learn how to create chains of Promises, and how to pass data between them. Mathieu will also demonstrate how to use Promise.finally() to create clean-up functions that run regardless of whether a Promise chain resolves or rejects.

In chapter three, you will learn about Promises in ES6, including the new Promise constructor, arrow functions, and destructuring. Mathieu will also show you how to use Promise.resolve() and Promise.reject() to create Promises from existing values.

Chapter four focuses on Promises in AngularJS, an open-source front-end web application framework. You will learn how to use the $q service to create and manage Promises in AngularJS, and how to use $http to make HTTP requests that return Promises. Mathieu will also cover AngularJS promises in action, including how to use them with services and directives.

Chapter five is all about advanced Promise techniques. Mathieu will teach you about Promise composition, including how to create custom Promise combinators. He will also cover Promises with generators, and how to use them to create asynchronous iterators.

Finally, in chapter six, you will learn about Promises in production, including how to debug Promise code, how to handle Promise dependencies, and how to test Promise code using Jasmine. Mathieu will also demonstrate how to use Promises with Node.js and how to handle Promise rejections in TypeScript.

Overall, Learning JavaScript Promises: Practical Applications in ES6 and AngularJS from Packt Publishing is an in-depth course that is ideal for anyone who wants to learn how to effectively use Promises in their JavaScript projects. Whether you're a seasoned developer or new to JavaScript, this course will provide you with practical skills that you can apply to your own code.

Learning JavaScript Promises: Practical Applications in ES6 and AngularJS is a series that is currently running and has 1 seasons (20 episodes). The series first aired on October 29, 2015.

Filter by Source

Seasons
Race to the Finish Line
20. Race to the Finish Line
October 29, 2015
Given a list of tasks, we need to know as soon as a single one of them is complete Promise.all allowed us to wait for all. Promise.race will allow us to trigger as soon as any of the tasks are complete.
Promises Versus Events
19. Promises Versus Events
October 29, 2015
Most older JavaScript libraries deal exclusively in events when handling asynchronous processes. Here, we will compare the pros and cons of each.
The Pitfall of No Return
18. The Pitfall of No Return
October 29, 2015
As we will show in an example, not returning any value within a .catch can lead to unexpected behavior. We will see how to handle this correctly.
Make It All Asynchronous
17. Make It All Asynchronous
October 29, 2015
When a function needs to return a promise, for example, a service that's returning to a controller, but the return value is not guaranteed to be a promise, $q.when can be used to ensure that the return is indeed a promise.
Series Flow - with a Twist
16. Series Flow - with a Twist
October 29, 2015
In some cases, we do not know how many times a particular asynchronous task is expected to be run before stopping it. Using promises, we will be able to handle "n" tasks in a series.
Interdependent Tasks
15. Interdependent Tasks
October 29, 2015
Sometimes, several tasks need to be completed before a process can move on. A solution to this issue is to complete them one after the other. However, wherever possible, it is always more efficient to run tasks in parallel. $q.all allows you to combine promises in a way that must all complete before the surrounded process continues.
Parallel and Independent Tasks
14. Parallel and Independent Tasks
October 29, 2015
More than one action is needed and wherever possible, it is better to complete these actions in parallel without having to wait for the other to complete. We will use two API calls and display data in a simple case where the calls are independent of each other.
Turning Failure into Success
13. Turning Failure into Success
October 29, 2015
In the same vein as the previous video, this will cover cases where a certain block of a process needs to be transformed from a failure into a success. Promises allow us to do this by returning anything but a rejected promise.
Changing Successes into Failure
12. Changing Successes into Failure
October 29, 2015
When abstracting processes in general and not only asynchronous ones, we make an assumption as to what successes and what failures are. Promises make it very easy to switch from a success to a failure in the next promise, and we will learn how to accomplish this. We will also give practical examples as to why this would be a useful feature.
Making API Data User-ready
11. Making API Data User-ready
October 29, 2015
Promises that represent one action resolve with a certain value. This value may be suitable for one flow, but not for another. Returning a normal value allows you to modify the resolve value of a promise to make it more relevant to an outlying context. In practice, this is really useful when grabbing API content to be displayed to a user.
Chaining Promises
10. Chaining Promises
October 29, 2015
JavaScript applications are becoming more powerful and complex, and so are corresponding asynchronous flows. Promises help controlling such flows by using chaining, which not only allows to run processes one after the other but also to alter the value that comes out of the fulfillment of this, or even the success or failure path taken by the promise.
The Future Is Coming - Angular v2 Promises
9. The Future Is Coming - Angular v2 Promises
October 29, 2015
Angular 2 is coming and has everyone guessing with its breaking changes and new features. We will review where promises stand in that major overhaul.
Callbacks Execution and Timing
8. Callbacks Execution and Timing
October 29, 2015
A lot of processes will need to conduct more than one task upon completion of an action. Although promises are strongly single-chance and single-value, when it comes to the callbacks, developers can add as many as they want, even after the promise has been settled, and, thus, allow for several actions to be added from various parts of an application.
No Second Chance
7. No Second Chance
October 29, 2015
Some processes and flows require repeated information to be passed at unexpected times. Other flows, though of an unknown duration, expect their outcome to be final. Promises do not allow for second chances and, thus, are great tools to cover the latter of these cases.
Deciding What's Next
6. Deciding What's Next
October 29, 2015
Asynchronous process flows that are handled by promises are all about clarity of code and outcomes. Here, we will learn about various ways to set callbacks for each case are success only, failure only, both success and failure. Fulfilling promises is similar to a try catch clause; Angular added finally callback to handle case where something needs to be done regardless of success or fail.
There Are Only Two Types of Promises in This World
5. There Are Only Two Types of Promises in This World
October 29, 2015
Promises allow us to code parts of an asynchronous flow. Flows rarely follow a single direction; there are cases where things go awry. Promises prepare for these instances by having two possible outcomes: success and failure.
Creating ES6 Promises
4. Creating ES6 Promises
October 29, 2015
Promises have become so popular that the new iteration of JavaScript ES6 implements them. This implementation is slightly different than the Angular $q service. We will learn how to create promises using the ES6 promises API.
Make Me a Promise
3. Make Me a Promise
October 29, 2015
Some services ($http) return promise objects when called, but other processes do not. Often, a developer will need to create their own asynchronous process, such as waiting for some user interactions or the completion of a navigator action. The $q service provides the tool to handle such cases.
Promises - You've Been Using Them All Along
2. Promises - You've Been Using Them All Along
October 29, 2015
Many processes in JavaScript are asynchronous and, thus, can be confusing for developers whose experience is mostly synchronous. Promise objects allow for a clear way to handle such processes.
The Course Overview
1. The Course Overview
October 29, 2015
This video will offer an overview of the course.
Description
Where to Watch Learning JavaScript Promises: Practical Applications in ES6 and AngularJS
Learning JavaScript Promises: Practical Applications in ES6 and AngularJS is available for streaming on the Packt Publishing website, both individual episodes and full seasons. You can also watch Learning JavaScript Promises: Practical Applications in ES6 and AngularJS on demand at Amazon.
  • Premiere Date
    October 29, 2015