function repeatUntil(checkFunction) {
  var logTime = Date.now() + LOG_INTERVAL;
  var step = function() {
    return Promise.resolve(checkFunction()).then(function(result) {
      if (result instanceof pending) {
        if (Date.now() > logTime) {
          console.warn(result.message);
          logTime += LOG_INTERVAL;
        }
        return wait(REPEAT_UNTIL_INTERVAL).then(step);
      } else {
        return result;
      }
    });
  };
  return step();
}
/**
 * Waits until the checkFunction returns a value but a pending marker.
 * @param {function():*} checkFunction Function to check a condition. It can
 *     return a pending marker created by a pending function.
 * @return {Promise} Promise to be fulfilled with the return value of
 *     checkFunction when the checkFunction reutrns a value but a pending
 *     marker.
 */
Waits until the checkFunction returns a value but a pending marker.
@param {function():*} checkFunction Function to check a condition. It can
return a pending marker created by a pending function.
@return {Promise} Promise to be fulfilled with the return value of
checkFunction when the checkFunction reutrns a value but a pending
marker.
Waits until the checkFunction returns a value but a pending marker . @param { function () : * } checkFunction Function to check a condition . It can return a pending marker created by a pending function . @return { Promise } Promise to be fulfilled with the return value of checkFunction when the checkFunction reutrns a value but a pending marker .
function repeatUntil(checkFunction) {
  var logTime = Date.now() + LOG_INTERVAL;
  var step = function() {
    return Promise.resolve(checkFunction()).then(function(result) {
      if (result instanceof pending) {
        if (Date.now() > logTime) {
          console.warn(result.message);
          logTime += LOG_INTERVAL;
        }
        return wait(REPEAT_UNTIL_INTERVAL).then(step);
      } else {
        return result;
      }
    });
  };
  return step();
}
function repeatUntil ( checkFunction ) { var logTime = Date . now ( ) + LOG_INTERVAL ; var step = function ( ) { return Promise . resolve ( checkFunction ( ) ) . then ( function ( result ) { if ( result instanceof pending ) { if ( Date . now ( ) > logTime ) { console . warn ( result . message ) ; logTime += LOG_INTERVAL ; } return wait ( REPEAT_UNTIL_INTERVAL ) . then ( step ) ; } else { return result ; } } ) ; } ; return step ( ) ; }
Waits until the checkFunction returns a value but a pending marker.
Waits until the checkFunction returns a value but a pending marker .