lib/Workpool.js
/**
   * Executes a while-loop style workpool task.
   * @param {Function} predicate A function, that when invoked will keep adding tasks to the workpool until
   * a falsy value is returned.
   * @return {Promise} The same promise returned from Workpool#addWhileTask
   */
Executes a while-loop style workpool task.
@param {Function} predicate A function, that when invoked will keep adding tasks to the workpool until
a falsy value is returned.
@return {Promise} The same promise returned from Workpool#addWhileTask
Executes a while - loop style workpool task . @param { Function } predicate A function that when invoked will keep adding tasks to the workpool until a falsy value is returned . @return { Promise } The same promise returned from Workpool#addWhileTask
while(predicate) {
    if (!(predicate instanceof Function)) {
      throw new TypeError(
        `Workpool#while expected argument #0 (predicate) to be a function, but got ${typeof predicate}.`
      );
    } else {
      return {
        do: (command, ...rest) => {
          const done = rest._.getAndStripCallback();
          return this.addWhileTask(predicate, command, rest[0], rest[1], done);
        },
      };
    }
  }
while ( predicate ) { if ( ! ( predicate instanceof Function ) ) { throw new TypeError ( ` ${ typeof predicate } ` ) ; } else { return { do : ( command , ... rest ) => { const done = rest . _ . getAndStripCallback ( ) ; return this . addWhileTask ( predicate , command , rest [ 0 ] , rest [ 1 ] , done ) ; } , } ; } }
Executes a while-loop style workpool task.
Executes a while - loop style workpool task .