function sendData() {
  if (packageQueue[0].length == 0) {
    packageQueue.shift();
    return;
  }
  let collection = packageQueue[0][0]?.outerWidth ? 'staticData' : 'clickEvents';
  if (socket.readyState == 1) {
    socket.send(JSON.stringify({
      collection: collection,
      body: packageQueue[0]
    }));
  }
}
/**
 * Makes a POST request using fetch() to the endpoint with the packaged data from the queue
 */
Makes a POST request using fetch() to the endpoint with the packaged data from the queue
Makes a POST request using fetch () to the endpoint with the packaged data from the queue
function sendData() {
  if (packageQueue[0].length == 0) {
    packageQueue.shift();
    return;
  }
  let collection = packageQueue[0][0]?.outerWidth ? 'staticData' : 'clickEvents';
  if (socket.readyState == 1) {
    socket.send(JSON.stringify({
      collection: collection,
      body: packageQueue[0]
    }));
  }
}
function sendData ( ) { if ( packageQueue [ 0 ] . length == 0 ) { packageQueue . shift ( ) ; return ; } let collection = packageQueue [ 0 ] [ 0 ] ?. outerWidth ? 'staticData' : 'clickEvents' ; if ( socket . readyState == 1 ) { socket . send ( JSON . stringify ( { collection : collection , body : packageQueue [ 0 ] } ) ) ; } }
Makes a POST request using fetch() to the endpoint with the packaged data from the queue
Makes a POST request using fetch () to the endpoint with the packaged data from the queue