src/libs/Bus.js
function unsubscribeFrom(sChannelId, sEventType, oSubscriber) {
  const aChannelEvents = _getChannelEvents(sChannelId, sEventType);
  for (let nEvent = aChannelEvents.length - 1; nEvent >= 0; nEvent--) {
    const oItem = aChannelEvents[nEvent];
    if (oItem.subscriber === oSubscriber) {
      aChannelEvents.splice(nEvent, 1);
    }
  }
}
function unsubscribeFrom(sChannelId, sEventType, oSubscriber) {
  const aChannelEvents = _getChannelEvents(sChannelId, sEventType);
  for (let nEvent = aChannelEvents.length - 1; nEvent >= 0; nEvent--) {
    const oItem = aChannelEvents[nEvent];
    if (oItem.subscriber === oSubscriber) {
      aChannelEvents.splice(nEvent, 1);
    }
  }
}
function unsubscribeFrom ( sChannelId , sEventType , oSubscriber ) { const aChannelEvents = _getChannelEvents ( sChannelId , sEventType ) ; for ( let nEvent = aChannelEvents . length - 1 ; nEvent >= 0 ; nEvent -- ) { const oItem = aChannelEvents [ nEvent ] ; if ( oItem . subscriber === oSubscriber ) { aChannelEvents . splice ( nEvent , 1 ) ; } } }
Method to unsubscribe a subscriber from a channel and event type.
It iterates in reverse order to avoid messing with array length when removing items.
@param {String} sChannelId
@param {String} sEventType
@param {Object} oSubscriber
Method to unsubscribe a subscriber from a channel and event type . It iterates in reverse order to avoid messing with array length when removing items .