dist/es/methods/node.js
function emitOverFastPath(state, msgObj, messageJson) {
  if (!state.options.node.useFastPath) return; // disabled

  var others = OTHER_INSTANCES[state.channelName].filter(function (s) {
    return s !== state;
  });
  var checkObj = {
    time: msgObj.time,
    senderUuid: msgObj.uuid,
    token: msgObj.token
  };
  others.filter(function (otherState) {
    return _filterMessage(checkObj, otherState);
  }).forEach(function (otherState) {
    otherState.messagesCallback(messageJson);
  });
}
function emitOverFastPath(state, msgObj, messageJson) {
  if (!state.options.node.useFastPath) return; // disabled

  var others = OTHER_INSTANCES[state.channelName].filter(function (s) {
    return s !== state;
  });
  var checkObj = {
    time: msgObj.time,
    senderUuid: msgObj.uuid,
    token: msgObj.token
  };
  others.filter(function (otherState) {
    return _filterMessage(checkObj, otherState);
  }).forEach(function (otherState) {
    otherState.messagesCallback(messageJson);
  });
}
function emitOverFastPath ( state , msgObj , messageJson ) { if ( ! state . options . node . useFastPath ) return ; // disabled var others = OTHER_INSTANCES [ state . channelName ] . filter ( function ( s ) { return s !== state ; } ) ; var checkObj = { time : msgObj . time , senderUuid : msgObj . uuid , token : msgObj . token } ; others . filter ( function ( otherState ) { return _filterMessage ( checkObj , otherState ) ; } ) . forEach ( function ( otherState ) { otherState . messagesCallback ( messageJson ) ; } ) ; }
When multiple BroadcastChannels with the same name
are created in a single node-process, we can access them directly and emit messages.
This might not happen often in production
but will speed up things when this module is used in unit-tests.
When multiple BroadcastChannels with the same name are created in a single node - process we can access them directly and emit messages . This might not happen often in production but will speed up things when this module is used in unit - tests .