How to use the threads/worker.expose function in threads

To help you get started, we’ve selected a few threads examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github higlass / higlass / app / scripts / data-fetchers / bam-fetcher-worker.js View on Github external
// eslint-disable-next-line
  console.log('renderSegments took', performance.now() - t1);

  // Fritz: why are the two buffers returned twice?
  return Transfer(objData, [positionsBuffer, colorsBuffer]);
};

const tileFunctions = {
  init,
  tilesetInfo,
  fetchTilesDebounced,
  tile,
  renderSegments,
};

expose(tileFunctions);