I need to call a function when a class has been removed from an element, **I have no control over when the class is removed.** 

Currently I can make it work by using setTimeout, so it's something like:

```
function checkClassRemoval() {
    if (!$('.myElement').hasClass('mySecondClass')) {
        // run function
    }   
}   

setTimeout(checkClassRemoval, 1000);

```

Is there a better way to catch the removal of the class than running a check every second?