Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from Xmader/patch-1
Browse files Browse the repository at this point in the history
Implement opts.reverse in iterator
  • Loading branch information
aphelionz authored May 11, 2020
2 parents cee0a65 + c398a13 commit 3023d4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/EventStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class EventStore extends Store {
// Lower than and lastN case, search latest first by reversing the sequence
result = this._read(events.reverse(), opts.lt ? opts.lt : opts.lte, amount, opts.lte || !opts.lt).reverse()
}

if (opts.reverse) {
result.reverse()
}

return result
}
Expand Down

0 comments on commit 3023d4a

Please sign in to comment.