Closed ryanmitchell closed 2 years ago
This goes hand in hand with https://github.com/tastyigniter/TastyIgniter/pull/933 .
Events would become actual events... Pipelines would be used for anything we want a response from.
This should now be complete, any events that we dont get a response from are converted to classes. The remainder I'll handle in the pipe PR.
Instead of removing the namespaced events, we should deprecate them and remove in v5 to avoid breaking extensions.
Nice naming convention you used for the event class names Domain\Events\Context\EventName
.
For scenarios when the namespace has more than 2 levels, such as 'Admin\Events\DashboardWidgets\Charts\ExtendDatasets,' convert them to 'Admin\Events\DashboardWidgets\ExtendChartsDatasets.'
With this, I believe we should leave the fireSystemEvent
and fireEvent
in place for the time being until we figure out the optimal way, and only replace events dispatched with Event::fire
because they are global events that rarely return anything. I've also included a sample with GetActiveTheme
that we can use in situations where we expect a response (maybe not the best approach but works).
I've switched to using the dispatch method rather than the event helper, and I'm open to revert.
I prefer dispatch - had used that initially but you asked me to change :)
don’t mind what event format we take but do feel it would be better to have a consistent signature/method rather than different ones for each event.
I prefer dispatch - had used that initially but you asked me to change :)
My bad, it be like that sometime lol
don’t mind what event format we take but do feel it would be better to have a consistent signature/method rather than different ones for each event.
Yes, we can always revisit in future :)
Does what it says on the tin.
@sampoyigi if we are going to hold this back to v4 then what do you think about dropping support for legacy events, it makes things much easier.