lib/index.js
function off(evt, handler) {
            var _this2 = this;

            var thisArg = arguments[2] === undefined ? null : arguments[2];

            // handle multiple events appropriately.
            if (eachEvt(evt, handler, thisArg, function () {
                for (var _len3 = arguments.length, _ = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
                    _[_key3] = arguments[_key3];
                }

                return _this2.off.apply(_this2, _);
            })) {
                return this;
            }if (evt === undefined && handler === undefined && thisArg === null) {
                // remove all event handlers. Easiest way to do this is just create a new event map
                this[_eventHandlers] = new core.Map();
                return this;
            }

            var eH = this[_eventHandlers];

            if (handler === undefined && thisArg === null) {
                // remove all handlers for a specific event. Easiest way to do this is just create a new object map
                eH.set(evt, new core.Map());
                return this;
            }

            var objMap = eH.get(evt);
            if (objMap !== undefined) {
                // the following cases apply only if we have an object map for the event -- otherwise we do nothing.
                if (typeof handler === "object") {
                    // remove all handlers in a given event category for a specific object
                    objMap["delete"](handler);
                    return this;
                }

                // only remove if we have the event map in the first place
                var handlerSet = objMap.get(thisArg);
                if (handlerSet !== undefined) {
                    handlerSet["delete"](handler);
                    if (handlerSet.size === 0) {
                        eH["delete"](objMap);
                    }
                }
            }

            return this;
        }
function off(evt, handler) {
            var _this2 = this;

            var thisArg = arguments[2] === undefined ? null : arguments[2];

            // handle multiple events appropriately.
            if (eachEvt(evt, handler, thisArg, function () {
                for (var _len3 = arguments.length, _ = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
                    _[_key3] = arguments[_key3];
                }

                return _this2.off.apply(_this2, _);
            })) {
                return this;
            }if (evt === undefined && handler === undefined && thisArg === null) {
                // remove all event handlers. Easiest way to do this is just create a new event map
                this[_eventHandlers] = new core.Map();
                return this;
            }

            var eH = this[_eventHandlers];

            if (handler === undefined && thisArg === null) {
                // remove all handlers for a specific event. Easiest way to do this is just create a new object map
                eH.set(evt, new core.Map());
                return this;
            }

            var objMap = eH.get(evt);
            if (objMap !== undefined) {
                // the following cases apply only if we have an object map for the event -- otherwise we do nothing.
                if (typeof handler === "object") {
                    // remove all handlers in a given event category for a specific object
                    objMap["delete"](handler);
                    return this;
                }

                // only remove if we have the event map in the first place
                var handlerSet = objMap.get(thisArg);
                if (handlerSet !== undefined) {
                    handlerSet["delete"](handler);
                    if (handlerSet.size === 0) {
                        eH["delete"](objMap);
                    }
                }
            }

            return this;
        }
function off ( evt , handler ) { var _this2 = this ; var thisArg = arguments [ 2 ] === undefined ? null : arguments [ 2 ] ; // handle multiple events appropriately. if ( eachEvt ( evt , handler , thisArg , function ( ) { for ( var _len3 = arguments . length , _ = Array ( _len3 ) , _key3 = 0 ; _key3 < _len3 ; _key3 ++ ) { _ [ _key3 ] = arguments [ _key3 ] ; } return _this2 . off . apply ( _this2 , _ ) ; } ) ) { return this ; } if ( evt === undefined && handler === undefined && thisArg === null ) { // remove all event handlers. Easiest way to do this is just create a new event map this [ _eventHandlers ] = new core . Map ( ) ; return this ; } var eH = this [ _eventHandlers ] ; if ( handler === undefined && thisArg === null ) { // remove all handlers for a specific event. Easiest way to do this is just create a new object map eH . set ( evt , new core . Map ( ) ) ; return this ; } var objMap = eH . get ( evt ) ; if ( objMap !== undefined ) { // the following cases apply only if we have an object map for the event -- otherwise we do nothing. if ( typeof handler === "object" ) { // remove all handlers in a given event category for a specific object objMap [ "delete" ] ( handler ) ; return this ; } // only remove if we have the event map in the first place var handlerSet = objMap . get ( thisArg ) ; if ( handlerSet !== undefined ) { handlerSet [ "delete" ] ( handler ) ; if ( handlerSet . size === 0 ) { eH [ "delete" ] ( objMap ) ; } } } return this ; }
Removes handlers from an event. This one is a bit complicated, because it supports various
overloads that do slightly different things.

* If `evt`, `handler`, and `thisArg` are supplied, the handler is removed as would be expected.
If no `thisArg` is supplied, the `handler` is removed from the `null` category.
* If `handler` is an object and not a method, it is assumed to be `thisArg`. With no handlers
specified to remove, _all_ handlers within the object map are removed.
* If only an `evt` is specified, all handlers and objects are removed.
* If no parameters are supplied, all handlers are removed for all events.

@param {string|Array<string>|Object} [evt]
@param {function|Object} [handler]
@param {Object} [thisArg]
@returns {Emitter}
Removes handlers from an event . This one is a bit complicated because it supports various overloads that do slightly different things .