lib/defaultCommandHandler.js
function (cmd, callback) {
    var getNewIdFn = this.eventStore.getNewId.bind(this.eventStore);
    if (this.aggregate && this.aggregate.getNewAggregateId) {
      getNewIdFn = this.aggregate.getNewAggregateId.bind(this.aggregate);
    } else if (this.getNewAggregateIdFn) {
      getNewIdFn = this.getNewAggregateIdFn.bind(this);
    }

    if (getNewIdFn.length === 2) {
      return getNewIdFn(cmd, callback);
    }

    getNewIdFn(callback);
  }
function (cmd, callback) {
    var getNewIdFn = this.eventStore.getNewId.bind(this.eventStore);
    if (this.aggregate && this.aggregate.getNewAggregateId) {
      getNewIdFn = this.aggregate.getNewAggregateId.bind(this.aggregate);
    } else if (this.getNewAggregateIdFn) {
      getNewIdFn = this.getNewAggregateIdFn.bind(this);
    }

    if (getNewIdFn.length === 2) {
      return getNewIdFn(cmd, callback);
    }

    getNewIdFn(callback);
  }
function ( cmd , callback ) { var getNewIdFn = this . eventStore . getNewId . bind ( this . eventStore ) ; if ( this . aggregate && this . aggregate . getNewAggregateId ) { getNewIdFn = this . aggregate . getNewAggregateId . bind ( this . aggregate ) ; } else if ( this . getNewAggregateIdFn ) { getNewIdFn = this . getNewAggregateIdFn . bind ( this ) ; } if ( getNewIdFn . length === 2 ) { return getNewIdFn ( cmd , callback ) ; } getNewIdFn ( callback ) ; }
IdGenerator function for aggregate id.
@param {Function} callback The function, that will be called when this action is completed.
`function(err, newId){}`
IdGenerator function for aggregate id .