{"size": 367, "ext": "js", "max_stars_repo_path": "ch06/09_promise-flow/01_concurrent.js", "max_stars_repo_name": "marufsiddiqui/buildfirst", "max_stars_repo_stars_event_min_datetime": "2019-04-15T16:35:33.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-15T16:35:33.000Z", "max_issues_repo_path": "ch06/09_promise-flow/01_concurrent.js", "max_issues_repo_name": "marufsiddiqui/buildfirst", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ch06/09_promise-flow/01_concurrent.js", "max_forks_repo_name": "marufsiddiqui/buildfirst", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.3888888889, "max_line_length": 48, "alphanum_fraction": 0.6158038147}
var Promise = require('es6-promise').Promise;

function delay (t) {
  function wait (fulfill) {
    setTimeout(function () {
      console.log('Resolving after', t);
      fulfill(t);
    }, t);
  }
  return new Promise(wait);
}

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