Skip to content

Commit

Permalink
set revMin optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano Raiano committed Feb 14, 2012
1 parent b4894d8 commit f07cc28
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/eventStore.js
Expand Up @@ -273,17 +273,23 @@ Store.prototype = {
);
},

// __getEventStream:__ loads the eventstream from _minRev_ to _maxRev_.
// __getEventStream:__ loads the eventstream from _revMin_ to _revMax_.
//
// `eventStore.getEventStream(streamId, minRev, maxRev, callback)`
//
// - __streamId:__ id for requested stream (equal to aggregateId)
// - __minRev:__ revision startpoint
// - __maxRev:__ revision endpoint (hint: -1 = to end) [optional]
// - __revMin:__ revision startpoint [optional]
// - __revMax:__ revision endpoint (hint: -1 = to end) [optional]
// - __callback:__ `function(err, snapshot, eventStream){}`
getEventStream: function(streamId, revMin, revMax, callback) {

if (this.hasConfigurationErrors(callback)) return;

if (typeof revMin === 'function') {
callback = revMin;
revMin = 0;
revMax = -1;
}

if (typeof revMax === 'function') {
callback = revMax;
Expand Down

0 comments on commit f07cc28

Please sign in to comment.