Execute function after provideUI()

I’d like to run a small function whenever provideUI() shows the plugin UI. I want to attach some event listeners to the elements and run an initial code that needs to run once every time the UI comes up. What is the best way to do this? I tried a couple of things, but none worked so far:

  1. tried to use data-on-load
  2. tried to use data-on-visibilitychange
    Basically being able to run one of the functions declared in provideModel() automatically would be great.

Regards, Michael