lib/eventstore.js
function (commitStamp, skip, limit, callback) {
    if (!commitStamp) {
      var err = new Error('Please pass in a date object!');
      debug(err);
      throw err;
    }

    if (typeof skip === 'function') {
      callback = skip;
      skip = 0;
      limit = -1;
    } else if (typeof limit === 'function') {
      callback = limit;
      limit = -1;
    }

    var self = this;

    function nextFn(callback) {
      if (limit < 0) {
        var resEvts = [];
        resEvts.next = nextFn;
        return process.nextTick(function () { callback(null, resEvts) });
      }
      skip += limit;
      _getEventsSince(commitStamp, skip, limit, callback);
    }

    commitStamp = new Date(commitStamp);

    function _getEventsSince(commitStamp, skip, limit, callback) {
      self.store.getEventsSince(commitStamp, skip, limit, function (err, evts) {
        if (err) return callback(err);
        evts.next = nextFn;
        callback(null, evts);
      });
    }

    _getEventsSince(commitStamp, skip, limit, callback);
  }
function (commitStamp, skip, limit, callback) {
    if (!commitStamp) {
      var err = new Error('Please pass in a date object!');
      debug(err);
      throw err;
    }

    if (typeof skip === 'function') {
      callback = skip;
      skip = 0;
      limit = -1;
    } else if (typeof limit === 'function') {
      callback = limit;
      limit = -1;
    }

    var self = this;

    function nextFn(callback) {
      if (limit < 0) {
        var resEvts = [];
        resEvts.next = nextFn;
        return process.nextTick(function () { callback(null, resEvts) });
      }
      skip += limit;
      _getEventsSince(commitStamp, skip, limit, callback);
    }

    commitStamp = new Date(commitStamp);

    function _getEventsSince(commitStamp, skip, limit, callback) {
      self.store.getEventsSince(commitStamp, skip, limit, function (err, evts) {
        if (err) return callback(err);
        evts.next = nextFn;
        callback(null, evts);
      });
    }

    _getEventsSince(commitStamp, skip, limit, callback);
  }
function ( commitStamp , skip , limit , callback ) { if ( ! commitStamp ) { var err = new Error ( 'Please pass in a date object!' ) ; debug ( err ) ; throw err ; } if ( typeof skip === 'function' ) { callback = skip ; skip = 0 ; limit = - 1 ; } else if ( typeof limit === 'function' ) { callback = limit ; limit = - 1 ; } var self = this ; function nextFn ( callback ) { if ( limit < 0 ) { var resEvts = [ ] ; resEvts . next = nextFn ; return process . nextTick ( function ( ) { callback ( null , resEvts ) } ) ; } skip += limit ; _getEventsSince ( commitStamp , skip , limit , callback ) ; } commitStamp = new Date ( commitStamp ) ; function _getEventsSince ( commitStamp , skip , limit , callback ) { self . store . getEventsSince ( commitStamp , skip , limit , function ( err , evts ) { if ( err ) return callback ( err ) ; evts . next = nextFn ; callback ( null , evts ) ; } ) ; } _getEventsSince ( commitStamp , skip , limit , callback ) ; }
loads all the events since passed commitStamp
@param {Date}     commitStamp the date object
@param {Number}   skip        how many events should be skipped? [optional]
@param {Number}   limit       how many events do you want in the result? [optional]
@param {Function} callback    the function that will be called when this action has finished
`function(err, events){}`
loads all the events since passed commitStamp