Coder Social home page Coder Social logo

async's Introduction

Async: Promise, Generators, Iterators, Async/Await

Given that we now have the fundamentals of modern JS down, it's time to focus on two of the more exciting new features of ES6: Promises and Generators.

In this tutorial, we will deep-dive into Promises and Generators (with a little side trip to understanding iterators) - and put what we learned in the fundamentals tutorials into practice. Once we get a handle on them, we will create an implementation of "async/await" - which is an upcoming ES7 feature that makes async programming much easier.

To see how all this is used in the real world, we will look at how Mozilla has been using generators+promises to implement features for the web, and take a look at how it can be super useful in testing programs that do async things (e.g., network and database calls).

In detail, what we will cover:

  • Promises:
    • What/why are they?
    • how to create them and when to use them.
    • how to wrap legacy APIs, like XHR, in a promise.
  • Promise statics:
    • Promise .all() .race(), .resolve(), .reject().
  • Iterators:
    • Symbol.iterator.
    • "Roll your own" iterable objects.
  • Generators:
    • theory/mechanics, and API.
  • Using Generators + Promises to implement "async/await"

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

async's People

Contributors

marcoscaceres avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.