dist/model.js
function wrapPromise(promise) {
  return promise.then(function (value) {
    return new Promise(function (resolve, reject) {
      _object2.default.delay(function () {
        resolve(value);
      });
      _object2.default._queueFlush();
    });
  }, function (reason) {
    return new Promise(function (resolve, reject) {
      _object2.default.delay(function () {
        reject(reason);
      });
      _object2.default._queueFlush();
    });
  });
}
function wrapPromise(promise) {
  return promise.then(function (value) {
    return new Promise(function (resolve, reject) {
      _object2.default.delay(function () {
        resolve(value);
      });
      _object2.default._queueFlush();
    });
  }, function (reason) {
    return new Promise(function (resolve, reject) {
      _object2.default.delay(function () {
        reject(reason);
      });
      _object2.default._queueFlush();
    });
  });
}
Internal: Wraps the given promise so that subsequent chained promises are called after the next flush cycle has been run.