Maybe something to think about: you could use a custom event for this. So in the component where your function remains, add a global event listener which calls that function. And then from anywhere in your app, emit that event ant the function will be executed.
Bonus: you could even transfer function arguments through the event data.