examples/npm/output.js
function(eventName) {
      var list, calls, ev, callback, args;
      var both = 2;
      if (!(calls = this._callbacks)) return this;
      while (both--) {
        ev = both ? eventName : 'all';
        if (list = calls[ev]) {
          for (var i = 0, l = list.length; i < l; i++) {
            if (!(callback = list[i])) {
              list.splice(i, 1); i--; l--;
            } else {
              args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
              callback[0].apply(callback[1] || this, args);
            }
          }
        }
      }
      return this;
    }
function(eventName) {
      var list, calls, ev, callback, args;
      var both = 2;
      if (!(calls = this._callbacks)) return this;
      while (both--) {
        ev = both ? eventName : 'all';
        if (list = calls[ev]) {
          for (var i = 0, l = list.length; i < l; i++) {
            if (!(callback = list[i])) {
              list.splice(i, 1); i--; l--;
            } else {
              args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
              callback[0].apply(callback[1] || this, args);
            }
          }
        }
      }
      return this;
    }
function ( eventName ) { var list , calls , ev , callback , args ; var both = 2 ; if ( ! ( calls = this . _callbacks ) ) return this ; while ( both -- ) { ev = both ? eventName : 'all' ; if ( list = calls [ ev ] ) { for ( var i = 0 , l = list . length ; i < l ; i ++ ) { if ( ! ( callback = list [ i ] ) ) { list . splice ( i , 1 ) ; i -- ; l -- ; } else { args = both ? Array . prototype . slice . call ( arguments , 1 ) : arguments ; callback [ 0 ] . apply ( callback [ 1 ] || this , args ) ; } } } } return this ; }
Trigger an event, firing all bound callbacks. Callbacks are passed the same arguments as `trigger` is, apart from the event name. Listening for `"all"` passes the true event name as the first argument.
Trigger an event firing all bound callbacks . Callbacks are passed the same arguments as trigger is apart from the event name . Listening for all passes the true event name as the first argument .