eventsAfterId method

List<Map<String, Object?>> eventsAfterId(
  1. int afterId, {
  2. int limit = 50000,
})

Rows newer than afterId, in insertion order. Reads the persisted store when there is one (so events from earlier processes are included).

Implementation

List<Map<String, Object?>> eventsAfterId(int afterId, {int limit = 50000}) {
  final s = store;
  if (s != null) return s.rowsAfterId(afterId, limit: limit);
  final out = <Map<String, Object?>>[];
  for (final e in _events) {
    if (e.id <= afterId) continue;
    out.add(e.toRow());
    if (out.length >= limit) break;
  }
  return out;
}