code: function makeDeferred() {
    var resolvePromise = null;
    var rejectPromise = null;
  
    var promise = new Promise(function (resolve, reject) {
      resolvePromise = resolve;
      rejectPromise = reject;
    });
  
    return {
      promise: promise,
      resolve: resolvePromise,
      reject: rejectPromise
    };
  }
docs: /*
  This lets us resolve the promise outside the
  promise function itself.