src/mixin/Eventful.js
function (event, handler) {
        var _h = this._$handlers;

        if (!event) {
            this._$handlers = {};
            return this;
        }

        if (handler) {
            if (_h[event]) {
                var newList = [];
                for (var i = 0, l = _h[event].length; i < l; i++) {
                    if (_h[event][i].h !== handler) {
                        newList.push(_h[event][i]);
                    }
                }
                _h[event] = newList;
            }

            if (_h[event] && _h[event].length === 0) {
                delete _h[event];
            }
        }
        else {
            delete _h[event];
        }

        return this;
    }
function (event, handler) {
        var _h = this._$handlers;

        if (!event) {
            this._$handlers = {};
            return this;
        }

        if (handler) {
            if (_h[event]) {
                var newList = [];
                for (var i = 0, l = _h[event].length; i < l; i++) {
                    if (_h[event][i].h !== handler) {
                        newList.push(_h[event][i]);
                    }
                }
                _h[event] = newList;
            }

            if (_h[event] && _h[event].length === 0) {
                delete _h[event];
            }
        }
        else {
            delete _h[event];
        }

        return this;
    }
function ( event , handler ) { var _h = this . _$handlers ; if ( ! event ) { this . _$handlers = { } ; return this ; } if ( handler ) { if ( _h [ event ] ) { var newList = [ ] ; for ( var i = 0 , l = _h [ event ] . length ; i < l ; i ++ ) { if ( _h [ event ] [ i ] . h !== handler ) { newList . push ( _h [ event ] [ i ] ) ; } } _h [ event ] = newList ; } if ( _h [ event ] && _h [ event ] . length === 0 ) { delete _h [ event ] ; } } else { delete _h [ event ] ; } return this ; }
Unbind a event.

@param {string} event The event name.
@param {Function} [handler] The event handler.
Unbind a event .