lib/defaultCommandHandler.js
function (aggId) {
    if (!aggId || !_.isString(aggId)) {
      var err = new Error('Please pass a valid aggregate id!');
      debug(err);
      throw err;
    }

    if (this.queue[aggId] && this.queue[aggId].length > 0) {
      var nextCmd = this.queue[aggId][0];
      return nextCmd;
    }

    return null;
  }
function (aggId) {
    if (!aggId || !_.isString(aggId)) {
      var err = new Error('Please pass a valid aggregate id!');
      debug(err);
      throw err;
    }

    if (this.queue[aggId] && this.queue[aggId].length > 0) {
      var nextCmd = this.queue[aggId][0];
      return nextCmd;
    }

    return null;
  }
function ( aggId ) { if ( ! aggId || ! _ . isString ( aggId ) ) { var err = new Error ( 'Please pass a valid aggregate id!' ) ; debug ( err ) ; throw err ; } if ( this . queue [ aggId ] && this . queue [ aggId ] . length > 0 ) { var nextCmd = this . queue [ aggId ] [ 0 ] ; return nextCmd ; } return null ; }
Returns next command in the queue
@param {String} aggId The passed aggregate id.
@returns {Object}
Returns next command in the queue