Checking when function is complete?

Is there a way to add a listener or something to a function so when it’s finished it will run another function?

I need to run a function in a class, and when it’s completed run a function on the main timeline or elsewhere.

Thanks!