def load_aggregate(klass, id)
      agg = klass.new(id)

      start = 0
      page_size = 20
      stream(klass, id).read_events(start, page_size) do |events|
        agg.apply_events(events)
      end

      agg
    end
def load_aggregate(klass, id)
      agg = klass.new(id)

      start = 0
      page_size = 20
      stream(klass, id).read_events(start, page_size) do |events|
        agg.apply_events(events)
      end

      agg
    end
Creates a new repository using the underlying `store` (e.g. `MemoryEventStore`).
 - namespace - optional namespace allowing for multiple applications to share the same Eventstore
               database without name conflicts
 Loads an aggregate identified by `id` and `klass` from the repository.
 Returns an aggregate instance of class `klass` constructed by applying events from the corresponding
 stream.