src/promissory-arbiter.js
function removeSubscriber (args, token) {
    var
      topics = args.topics,
      suspendSubs = args.suspend;

    if (typeof token === 'string') {
      return !!applyTopicDescendents(
        suspendSubs ? suspendTopic : empty, 'subscriptions', token, topics
      );
    }

    var node = ancestorTopicSearch(token.topic, topics);
    if (node.topic !== token.topic) {
      return false;
    }

    var i = searchAround(
      getId, getPriority,
      token.id, token.priority,
      binaryIndexBy(getPriority, token.priority, node.subscriptions),
      node.subscriptions
    );

    if (i === -1) {
      return false;
    }

    if (suspendSubs) {
      return !!suspendNode(node.subscriptions[i]);
    }

    return !!node.subscriptions.splice(i, 1);
  }
function removeSubscriber (args, token) {
    var
      topics = args.topics,
      suspendSubs = args.suspend;

    if (typeof token === 'string') {
      return !!applyTopicDescendents(
        suspendSubs ? suspendTopic : empty, 'subscriptions', token, topics
      );
    }

    var node = ancestorTopicSearch(token.topic, topics);
    if (node.topic !== token.topic) {
      return false;
    }

    var i = searchAround(
      getId, getPriority,
      token.id, token.priority,
      binaryIndexBy(getPriority, token.priority, node.subscriptions),
      node.subscriptions
    );

    if (i === -1) {
      return false;
    }

    if (suspendSubs) {
      return !!suspendNode(node.subscriptions[i]);
    }

    return !!node.subscriptions.splice(i, 1);
  }
function removeSubscriber ( args , token ) { var topics = args . topics , suspendSubs = args . suspend ; if ( typeof token === 'string' ) { return ! ! applyTopicDescendents ( suspendSubs ? suspendTopic : empty , 'subscriptions' , token , topics ) ; } var node = ancestorTopicSearch ( token . topic , topics ) ; if ( node . topic !== token . topic ) { return false ; } var i = searchAround ( getId , getPriority , token . id , token . priority , binaryIndexBy ( getPriority , token . priority , node . subscriptions ) , node . subscriptions ) ; if ( i === - 1 ) { return false ; } if ( suspendSubs ) { return ! ! suspendNode ( node . subscriptions [ i ] ) ; } return ! ! node . subscriptions . splice ( i , 1 ) ; }
Finds the subscription associated with a token and removes or suspends is. If the subscription associated with a token cannot be found then this returns false. This usually means that the token was already removed.
Finds the subscription associated with a token and removes or suspends is . If the subscription associated with a token cannot be found then this returns false . This usually means that the token was already removed .