Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Promise Flow

Back in sample ch06e04 Asynchronous Flow, we've looked at concurrent and serial flows using async. Now we'll look at the same topic, but from the point of view of using Promises.

To test these samples out, you'll need to pick one of the options listed below.

  • Visit ES6 Fiddle, and paste the examples in there
  • Get the es6-promise polyfill and try them out on your own
  • Try them out in Chrome 32+, where Promises are enabled by default

As an example, below is how you can execute promises concurrently and wait on their resolution.

Promise
  .all([delay(700), delay(300), delay(500)])
  .then(function (results) {
    return delay(Math.min.apply(Math, results));
  });

Here's the complete list of examples you'll find in this sample.