export async function getMetricData()

in src/state/api.js [21:34]


export async function getMetricData(appName, metricName) {
  let updatedMetricName = metricName;

  Object.keys(UBLOCK_ORIGIN_PRIVACY_FILTER).forEach((filter) => {
    updatedMetricName = updatedMetricName.replace(
      filter,
      UBLOCK_ORIGIN_PRIVACY_FILTER[filter]
    );
  });

  // we added data to metric names to avoid the JSON resource
  // calls being blocked by uBlock Origin
  return fetchJSON(`/data/${appName}/metrics/data_${updatedMetricName}.json`);
}