How to define a custom class so the definition is visible to multiple custom code elements?

I'm trying to create an app that has some Mqtt client connections maintained at an app / page level in a way that they can be used by several custom actions to e.g. publish messages, subscribe, listen and consume messages. I could define an MqttManager object to manage the client connection and give / get access to it through the Provider framework in a custom widget, but I can't see where I should define the MqttManager class so that other custom actions will be able to use it and call its methods. Any pointers / tips?

4
2 replies