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

    this.queue[aggId] = this.queue[aggId] || [];
    this.queue[aggId].push({ command: cmd, callback: clb })
  }
function (aggId, cmd, clb) {
    if (!aggId || !_.isString(aggId)) {
      var err = new Error('Please pass a valid aggregate id!');
      debug(err);
      throw err;
    }
    if (!cmd || !_.isObject(cmd)) {
      var err = new Error('Please pass a valid command!');
      debug(err);
      throw err;
    }
    if (!clb || !_.isFunction(clb)) {
      var err = new Error('Please pass a valid callback!');
      debug(err);
      throw err;
    }

    this.queue[aggId] = this.queue[aggId] || [];
    this.queue[aggId].push({ command: cmd, callback: clb })
  }
function ( aggId , cmd , clb ) { if ( ! aggId || ! _ . isString ( aggId ) ) { var err = new Error ( 'Please pass a valid aggregate id!' ) ; debug ( err ) ; throw err ; } if ( ! cmd || ! _ . isObject ( cmd ) ) { var err = new Error ( 'Please pass a valid command!' ) ; debug ( err ) ; throw err ; } if ( ! clb || ! _ . isFunction ( clb ) ) { var err = new Error ( 'Please pass a valid callback!' ) ; debug ( err ) ; throw err ; } this . queue [ aggId ] = this . queue [ aggId ] || [ ] ; this . queue [ aggId ] . push ( { command : cmd , callback : clb } ) }
Queues the passed command and its callback.
@param {String}   aggId The passed aggregate id.
@param {Object}   cmd   The command to be queued.
@param {Function} clb   The callback of this command.
Queues the passed command and its callback .