mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
We issue broadcasts and subscribes in many places throughout the portal. To help keep the cognitive overhead low, this PR consolidates all PubSub functionality to the `Domain.PubSub` module. This allows for: - better maintainability - see all of the topics we use at a glance - consolidate repeated functionality (saved for a future PR) - use the module hierarchy to define function names, which feels more intuitive when reading and sets a convention We also introduce a `Domain.Events.Hooks` behavior to ensure all hooks comply with this simple contract, and we also introduce a convention to standardize on topic names using the module hierarchy defined herein. Lastly, we add convenience functions to the Presence modules to save a bit of duplication and chance for errors. This will make it much easier to maintain PubSub going forward. Related: #9501