Listen for event inside multiple functions
<p>I have a custom event which I listen to:</p>

<pre><code>$(document).on('MyCustomEvent', function(e, data) {

});
</code></pre>

<p>My problem is that I would like to know when <code>MyCustomEvent</code> has fired inside a lot of different functions. I don't want to attach the event handler inside each function, since it doesn't make any sense and will probably override eachother.</p>

<p>What I'm after is something like this:</p>

<pre><code>function one(){

    //"when MyCustomEvent is fired, do stuff with the 'data' here"
}

function two(){

    //"when MyCustomEvent is fired, do stuff with the 'data' here"
}
</code></pre>
