EventHub

Warn

  • Due to the way it handles subscriptions all callbacks passed in should not be inline closures, as it will be impossible to remove the event listener if it is not a pre-defined function.

Note

  • Uses a custom version of PubSub under the hood, however as this is effectively a singleton EventHub acts as a mockable wrapper for it.

The EventHub class deals with publishing and subscribing events to anything subscribed to it

(Void) EventHub()