src/core/core.js
function(event, fn) {
        // Get handle to event, creating it if necessary
        var callbacks = this._callbacks[event];
        if (!callbacks) {
            callbacks = this._callbacks[event] = (handlers[event] ||
                (handlers[event] = {}))[this[0]] = [];
            callbacks.context = this;
            callbacks.depth = 0;
        }
        // Push to callback array
        callbacks.push(fn);
    }
function(event, fn) {
        // Get handle to event, creating it if necessary
        var callbacks = this._callbacks[event];
        if (!callbacks) {
            callbacks = this._callbacks[event] = (handlers[event] ||
                (handlers[event] = {}))[this[0]] = [];
            callbacks.context = this;
            callbacks.depth = 0;
        }
        // Push to callback array
        callbacks.push(fn);
    }
function ( event , fn ) { // Get handle to event, creating it if necessary var callbacks = this . _callbacks [ event ] ; if ( ! callbacks ) { callbacks = this . _callbacks [ event ] = ( handlers [ event ] || ( handlers [ event ] = { } ) ) [ this [ 0 ] ] = [ ] ; callbacks . context = this ; callbacks . depth = 0 ; } // Push to callback array callbacks . push ( fn ) ; }
Add a function to the list of callbacks for an event
Add a function to the list of callbacks for an event