// public/assets/js/dataWorker.js

onmessage = function(e) {
  const { dashboardUrl, eventsUrl } = e.data;
  fetch(dashboardUrl)
    .then(r => r.json())
    .then(mainDashboardData => {
      fetch(eventsUrl)
        .then(r => r.json())
        .then(eventsData => {
          postMessage({ type: 'dashboard', data: { ...mainDashboardData, events: eventsData } });
        });
    });
};
