lib/decider/tasks/while-loop.js
function WhileLoop(name, deps, fragment, doneFn, options) {
  if (!(this instanceof WhileLoop)) {
    return new WhileLoop(name, deps, fragment, doneFn, options);
  }

  Task.apply(this, Array.prototype.slice.call(arguments));

  this.fragment = fragment;

  if (!_.isFunction(doneFn)) {
    throw new Error('You must provide a function to indicate when the loop is complete');
  }

  this.doneFn = doneFn;
  this.options = options || {};
}
function WhileLoop(name, deps, fragment, doneFn, options) {
  if (!(this instanceof WhileLoop)) {
    return new WhileLoop(name, deps, fragment, doneFn, options);
  }

  Task.apply(this, Array.prototype.slice.call(arguments));

  this.fragment = fragment;

  if (!_.isFunction(doneFn)) {
    throw new Error('You must provide a function to indicate when the loop is complete');
  }

  this.doneFn = doneFn;
  this.options = options || {};
}
function WhileLoop ( name , deps , fragment , doneFn , options ) { if ( ! ( this instanceof WhileLoop ) ) { return new WhileLoop ( name , deps , fragment , doneFn , options ) ; } Task . apply ( this , Array . prototype . slice . call ( arguments ) ) ; this . fragment = fragment ; if ( ! _ . isFunction ( doneFn ) ) { throw new Error ( 'You must provide a function to indicate when the loop is complete' ) ; } this . doneFn = doneFn ; this . options = options || { } ; }
The loop executes the `fragment` until the `doneFn` returns a truthy value

@constructor
The loop executes the fragment until the doneFn returns a truthy value