Learning JavaScript Promises

Course

Online

£ 15 VAT inc.

Description

  • Type

    Course

  • Methodology

    Online

  • Start date

    Different dates available

Take your first steps into the world of JavaScript Promises to effortlessly code in an asynchronous environmentPromises are the new rage! Within a year, they will be an indispensable tool for JavaScript developers, both frontend and backend. New navigator APIs such as battery status, geolocation, indexedDB, as well as libraries and frameworks such as Angular, Ionic, and more have already adopted Promises as the best way to handle asynchronous flow programming. From the most simple async tasks to parallel, series, and other convoluted flows, Promises will make your code clean, easy to understand, and actually fun to write. Promises—if you’ve ever coded an AJAX call, chances are you used them. But did you know they can be used to avoid race conditions, or that you can combine them into complex flows, and ultimately that they can make coding in asynchronous environments a breeze? Learning JavaScript Promises: Practical Applications in ES6 and AngularJS will help you learn all this and more. All the features are backed with a real-life examples, from a local weather forecast to a movie search on iTunes!Starting from the basics of resolving and rejecting Promises, we will gradually move on to controlling flows by redirecting outcomes, making failures into successes, and vice versa, and modifying data to make it ready for display. Once you have familiarized yourself with Promises, we will review the many awesome ways of combining Promises, such as waiting for all tasks or grabbing the first task to complete. Finally, we will ensure that you fully master Promises with a section on extra Promises that will provide further useful information and examples. Throughout the course, you will apply every single feature you have discovered by creating meaningful widgets that utilize Promises, both in ES6 and in AngularJS.

Facilities

Location

Start date

Online

Start date

Different dates availableEnrolment now open

About this course

Create your own Promises to handle asynchronous processes
Decide the fate of a process: either as a success or a failed task
Add callbacks to determine what should be done upon completion
Chain promises into a full asynchronous flow
Change failures into successes to meet the needs of your specific application
Modify data to make it ready for display
Fight race conditions: wait for several parallel tasks to complete before moving on
Combine a varying number of asynchronous tasks in a sequential order
Simulate asynchronous behavior 
Race Promises against each other and single out the fastest one
Choose between events and Promises

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Emagister S.L. (data controller) will process your data to carry out promotional activities (via email and/or phone), publish reviews, or manage incidents. You can learn about your rights and manage your preferences in the privacy policy.

Reviews

This centre's achievements

2021

All courses are up to date

The average rating is higher than 3.7

More than 50 reviews in the last 12 months

This centre has featured on Emagister for 6 years

Subjects

  • Javascript training
  • Javascript
  • Ajax

Course programme

Introducing Promises 3 lectures 15:44 The Course Overview This video will offer an overview of the course. Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
Introducing Promises 3 lectures 15:44 The Course Overview This video will offer an overview of the course. Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
The Course Overview This video will offer an overview of the course. The Course Overview This video will offer an overview of the course. The Course Overview This video will offer an overview of the course. The Course Overview This video will offer an overview of the course. This video will offer an overview of the course. This video will offer an overview of the course. Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Promises – You've Been Using Them All Along 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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
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.
  • Asynchronous objects can be launched and represented by deferred objects
  • Their outcome can be handled represented with the help of promise objects
  • The API data can be displayed on the screen using $http
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
Make Me a Promise 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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
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.
  • Create a new deferred object with the help of $q.defer
  • Launch an asynchronous action
  • Use the corresponding promise object to handle the outcome of the action
Resolving and Rejecting ES6 Promises 6 lectures 53:43 Creating ES6 Promises 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.
  • Create an executor
  • Create an promise with this executor
  • Use the two parameters callbacks
There Are Only Two Types of Promises in This World 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.
  • Plan an asynchronous flow
  • Using reject to signal a failure and resolve to signal a success
  • Handle what’s next in both cases
Deciding What’s Next Asynchronous process flows that are handled by promises are all about clarity of code and outcomes. Here, we will learn about the various ways to set callbacks for each case:
  • success only
  • failure only
  • both success and failure
  • Fulfilling promises is similar to a try catch clause; Angular added the .finally callback to handle a case where something needs to be done regardless of success or failure.
    • Use .then for success only or success + failure
    • Use .catch for rejection only
    • Understand Angular’s .finally callback
    No Second Chance 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.
    • Attempt to reject an already resolved promise or change the resolution value of a promise
    • Only a single value can be passed as a resolution value and this is why it's not a problem
    • Use the finality of a settlement to our advantage
    Callbacks Execution and Timing 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.
    • Adding several callbacks on a promise and review their execution order
    • The paths that will not be walked
    • Add callbacks after a promise has settled
    The Future Is Coming – Angular v2 Promises 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.
    • Install dependencies and gulp
    • Add a constructor on component
    • Use fetch to perform an AJAX call
    Resolving and Rejecting ES6 Promises. 6 lectures 53:43 Creating ES6 Promises 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.
    • Create an executor
    • Create an promise with this executor
    • Use the two parameters callbacks
    There Are Only Two Types of Promises in This World 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.
    • Plan an asynchronous flow
    • Using reject to signal a failure and resolve to signal a success
    • Handle what’s next in both cases
    Deciding What’s Next Asynchronous process flows that are handled by promises are all about clarity of code and outcomes. Here, we will learn about the various ways to set callbacks for each case:
  • success only
  • failure only
  • both success and failure
  • Fulfilling promises is similar to a try catch clause; Angular added the .finally callback to handle a case where something needs to be done regardless of success or failure.
    • Use .then for success only or success + failure
    • Use .catch for rejection only
    • Understand Angular’s .finally callback
    No Second Chance 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.
    • Attempt to reject an already resolved promise or change the resolution value of a promise
    • Only a single value can be passed as a resolution value and this is why it's not a problem
    • Use the finality of a settlement to our advantage
    Callbacks Execution and Timing 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.
    • Adding several callbacks on a promise and review their execution order
    • The paths that will not be walked
    • Add callbacks after a promise has settled
    The Future Is Coming – Angular v2 Promises 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.
    • Install dependencies and gulp
    • Add a constructor on component
    • Use fetch to perform an AJAX call
    Creating ES6 Promises 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.
    • Create an executor
    • Create an promise with this executor
    • Use the two parameters callbacks
    Creating ES6 Promises 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.
    • Create an executor
    • Create an promise with this executor
    • Use the two parameters callbacks
    Creating ES6 Promises 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 ttled, and, thus, allow for several actions to be added from various parts of an application.
    • Adding several callbacks on a promise and review their execution order
    • The paths that will not be...

    Additional information

    Basic Knowledge of JavaScript is required

    Learning JavaScript Promises

    £ 15 VAT inc.