src/event-listener.js
function (eventEmitter, eventName) {
				if (RUNTIME_CHECKS) {
					if (!!eventEmitter && !eventEmitter.addEventListener) {
						throw '"eventEmitter" argument must be an event emitter';
					}
					if (arguments.length > 1 && typeof eventName !== 'string') {
						throw '"eventName" argument must be a string';
					}
				}

				if (!this.__private || !this.__private.listeningTo) { return; } // Not listening to anything? We are done.

				var eventNames = eventName ? {} : this.__private.listeningTo;
				eventName && (eventNames[eventName] = true);

				for (eventName in eventNames) {
					var listeningToList = this.__private.listeningTo[eventName];
					if (!listeningToList) { continue; }
					filterList(listeningToList, eventName, eventEmitter);
					listeningToList.length || (delete this.__private.listeningTo[eventName]);
				}
			}
function (eventEmitter, eventName) {
				if (RUNTIME_CHECKS) {
					if (!!eventEmitter && !eventEmitter.addEventListener) {
						throw '"eventEmitter" argument must be an event emitter';
					}
					if (arguments.length > 1 && typeof eventName !== 'string') {
						throw '"eventName" argument must be a string';
					}
				}

				if (!this.__private || !this.__private.listeningTo) { return; } // Not listening to anything? We are done.

				var eventNames = eventName ? {} : this.__private.listeningTo;
				eventName && (eventNames[eventName] = true);

				for (eventName in eventNames) {
					var listeningToList = this.__private.listeningTo[eventName];
					if (!listeningToList) { continue; }
					filterList(listeningToList, eventName, eventEmitter);
					listeningToList.length || (delete this.__private.listeningTo[eventName]);
				}
			}
function ( eventEmitter , eventName ) { if ( RUNTIME_CHECKS ) { if ( ! ! eventEmitter && ! eventEmitter . addEventListener ) { throw '"eventEmitter" argument must be an event emitter' ; } if ( arguments . length > 1 && typeof eventName !== 'string' ) { throw '"eventName" argument must be a string' ; } } if ( ! this . __private || ! this . __private . listeningTo ) { return ; } // Not listening to anything? We are done. var eventNames = eventName ? { } : this . __private . listeningTo ; eventName && ( eventNames [ eventName ] = true ) ; for ( eventName in eventNames ) { var listeningToList = this . __private . listeningTo [ eventName ] ; if ( ! listeningToList ) { continue ; } filterList ( listeningToList , eventName , eventEmitter ) ; listeningToList . length || ( delete this . __private . listeningTo [ eventName ] ) ; } }
Stop listening to events. If no arguments are provided, the listener removes all its event listeners. Providing any or both of the optional arguments will filter the list of event listeners removed.
@instance
@arg {Object} [eventEmitter] - If provided, only callbacks attached to the given event emitter will be removed.
@arg {string} [eventName] - If provided, only callbacks attached to the given event name will be removed.
Stop listening to events . If no arguments are provided the listener removes all its event listeners . Providing any or both of the optional arguments will filter the list of event listeners removed .