Closed Samsinite closed 4 months ago
I wonder if we'd better use Rails.configuration.event_store
as an alias for ActiveEventStore.event_store
as it's the "recommended location"?
That means, adding an initializers (in the Railtie) setting Rails.configuration.event_store = ActiveEventStore.event_store
would make the browser work (and other tools relying on the default location).
What did you do?
Tried to mount
RailsEventStore::Browser
engine and load the page (followed these instructions).What did you expect to happen?
The page would load and I would be able to browse through the various events and stream specific events.
What actually happened?
It errored when trying to look up the event store using
Rails.configuration.event_store
because it was undefined.Additional context
Creating a custom engine that used:
worked instead.
Can you think of an ideal way that active event store could be setup so that using this engine just works? My initial thoughts are that this library can define its own engine to include instead, and add a section to the README about it:
But maybe a different approach would be better (such as calling
RailsEventStore::Browser.endpoint RubyEventStore::Browser::App.for(event_store_locator: -> { ActiveEventStore.event_store })
afterActiveEventStore.event_store
is set). Or if you aren't interested in supporting this engine out of the box, no worries, it is easy enough to define a custom one in-app. If you are interested in supporting this engine using active event store, let me know what apporach you'd like to take, I'd be happy to take a stab at it.Edit:
Actually, I think just calling
In the
config.to_prepare do
block afterActiveEventStore.event_store
is set would work best and "just work" as expected for developers.