src/event.js
function(events, callback, context) {
      var calls, event, node, tail, list;
      if (!callback) {
        return this;
      }
      events = events.split(eventSplitter);
      calls = this._callbacks || (this._callbacks = {});

      // Create an immutable callback list, allowing traversal during
      // modification.  The tail is an empty object that will always be used
      // as the next node.
      event = events.shift();
      while (event) {
        list = calls[event];
        node = list ? list.tail : {};
        node.next = tail = {};
        node.context = context;
        node.callback = callback;
        calls[event] = { tail: tail, next: list ? list.next : node };
        event = events.shift();
      }

      return this;
    }
function(events, callback, context) {
      var calls, event, node, tail, list;
      if (!callback) {
        return this;
      }
      events = events.split(eventSplitter);
      calls = this._callbacks || (this._callbacks = {});

      // Create an immutable callback list, allowing traversal during
      // modification.  The tail is an empty object that will always be used
      // as the next node.
      event = events.shift();
      while (event) {
        list = calls[event];
        node = list ? list.tail : {};
        node.next = tail = {};
        node.context = context;
        node.callback = callback;
        calls[event] = { tail: tail, next: list ? list.next : node };
        event = events.shift();
      }

      return this;
    }
function ( events , callback , context ) { var calls , event , node , tail , list ; if ( ! callback ) { return this ; } events = events . split ( eventSplitter ) ; calls = this . _callbacks || ( this . _callbacks = { } ) ; // Create an immutable callback list, allowing traversal during // modification.  The tail is an empty object that will always be used // as the next node. event = events . shift ( ) ; while ( event ) { list = calls [ event ] ; node = list ? list . tail : { } ; node . next = tail = { } ; node . context = context ; node . callback = callback ; calls [ event ] = { tail : tail , next : list ? list . next : node } ; event = events . shift ( ) ; } return this ; }
Bind one or more space separated events, `events`, to a `callback`
function. Passing `"all"` will bind the callback to all events fired.
Bind one or more space separated events events to a callback function . Passing all will bind the callback to all events fired .