src/promissory-arbiter.js
function hierarchicalTopicDispatcher (state, topic, data, options) {
    var
      lineage = findLineage(getTopic, isAncestorTopic, topic, state._topics),
      topicNode = lineage[lineage.length - 1],
      subscriptions = options.preventBubble
        ? topicNode.topic === topic ? topicNode.subscriptions : []
        : mergeBy(getFingerArrayPriority, map(getSubscriptions, lineage)),
      fulfilledPromise = subscriptionDispatcher(
        topic, data, options, subscriptions
      );

    if (options.persist) {
      var id = state.id();

      topicNode = addTopicLine(topic, topicNode);
      topicNode.persisted.push(
        {topic: topic, data: data, order: id}
      );
      fulfilledPromise.token = {
        topic: topic,
        id: id
      };
    }

    return fulfilledPromise;
  }
function hierarchicalTopicDispatcher (state, topic, data, options) {
    var
      lineage = findLineage(getTopic, isAncestorTopic, topic, state._topics),
      topicNode = lineage[lineage.length - 1],
      subscriptions = options.preventBubble
        ? topicNode.topic === topic ? topicNode.subscriptions : []
        : mergeBy(getFingerArrayPriority, map(getSubscriptions, lineage)),
      fulfilledPromise = subscriptionDispatcher(
        topic, data, options, subscriptions
      );

    if (options.persist) {
      var id = state.id();

      topicNode = addTopicLine(topic, topicNode);
      topicNode.persisted.push(
        {topic: topic, data: data, order: id}
      );
      fulfilledPromise.token = {
        topic: topic,
        id: id
      };
    }

    return fulfilledPromise;
  }
function hierarchicalTopicDispatcher ( state , topic , data , options ) { var lineage = findLineage ( getTopic , isAncestorTopic , topic , state . _topics ) , topicNode = lineage [ lineage . length - 1 ] , subscriptions = options . preventBubble ? topicNode . topic === topic ? topicNode . subscriptions : [ ] : mergeBy ( getFingerArrayPriority , map ( getSubscriptions , lineage ) ) , fulfilledPromise = subscriptionDispatcher ( topic , data , options , subscriptions ) ; if ( options . persist ) { var id = state . id ( ) ; topicNode = addTopicLine ( topic , topicNode ) ; topicNode . persisted . push ( { topic : topic , data : data , order : id } ) ; fulfilledPromise . token = { topic : topic , id : id } ; } return fulfilledPromise ; }
Takes care of all the heavy lifting of publishing a message. This includes locating all topics, their subscribers, publishing the data and, if necessary, storing the message for late subscribers.
Takes care of all the heavy lifting of publishing a message . This includes locating all topics their subscribers publishing the data and if necessary storing the message for late subscribers .