lib/definitions/aggregate.js
function (loadingTime, events) {
    var snapshotThreshold = 100;
    if (this.options.snapshotThreshold) {
      snapshotThreshold = this.options.snapshotThreshold;
    }

    if (this.options.snapshotThresholdMs) {
      return loadingTime >= this.options.snapshotThresholdMs;
    }

    return events.length >= snapshotThreshold;
  }
function (loadingTime, events) {
    var snapshotThreshold = 100;
    if (this.options.snapshotThreshold) {
      snapshotThreshold = this.options.snapshotThreshold;
    }

    if (this.options.snapshotThresholdMs) {
      return loadingTime >= this.options.snapshotThresholdMs;
    }

    return events.length >= snapshotThreshold;
  }
function ( loadingTime , events ) { var snapshotThreshold = 100 ; if ( this . options . snapshotThreshold ) { snapshotThreshold = this . options . snapshotThreshold ; } if ( this . options . snapshotThresholdMs ) { return loadingTime >= this . options . snapshotThresholdMs ; } return events . length >= snapshotThreshold ; }
Returns true if a new snapshot should be done.
@param {Number} loadingTime    The loading time in ms of the eventstore data.
@param {Array}  events         The loaded events.
@param {Object} aggregateModel The aggregate json object. [could be used for other algorithms]
@param {Array}  streams        All loaded eventstreams for this aggregate.
@returns {boolean}
Returns true if a new snapshot should be done .