index.js
function unsubscribe(event, callback) {
	/*jshint validthis: true */
	if (DEBUG_DISPATCHER) log.info('UNSUBSCRIBE: ' + event);
	if (!event || !callback) {
		return;
	}
	var callbacks = this._callbacks[event];
	if (callbacks) {
		for (var i = callbacks.length - 1; i >= 0; i--) {
			if (callbacks[i] === callback) {
				callbacks.splice(i, 1);
			}
		}
	}

	if (!callbacks || callbacks.length === 0) {
		this._client.unsubscribe(event);
	}

	return this;
}
function unsubscribe(event, callback) {
	/*jshint validthis: true */
	if (DEBUG_DISPATCHER) log.info('UNSUBSCRIBE: ' + event);
	if (!event || !callback) {
		return;
	}
	var callbacks = this._callbacks[event];
	if (callbacks) {
		for (var i = callbacks.length - 1; i >= 0; i--) {
			if (callbacks[i] === callback) {
				callbacks.splice(i, 1);
			}
		}
	}

	if (!callbacks || callbacks.length === 0) {
		this._client.unsubscribe(event);
	}

	return this;
}
function unsubscribe ( event , callback ) { /*jshint validthis: true */ if ( DEBUG_DISPATCHER ) log . info ( 'UNSUBSCRIBE: ' + event ) ; if ( ! event || ! callback ) { return ; } var callbacks = this . _callbacks [ event ] ; if ( callbacks ) { for ( var i = callbacks . length - 1 ; i >= 0 ; i -- ) { if ( callbacks [ i ] === callback ) { callbacks . splice ( i , 1 ) ; } } } if ( ! callbacks || callbacks . length === 0 ) { this . _client . unsubscribe ( event ) ; } return this ; }
Unsubscribes from a particular event.
@param event The string name passed to the "subscribe" call.
@param callback The callback passed to the "subscribe" call.
@returns {*} The context, for fluent calls.
Unsubscribes from a particular event .