This is a repo which demonstrates the use of worker threads with comlink in a normal browser window.
It requires one to serve this folder via a static server and it should allow cross origin requests and that's it.
For initial testing purposes the index.html renders a normal html code with index.js script. This script is responsible for initiating worker threads which will be fectched from the network. The worker file calculated prime numbers in the prime number function and returns all the prime numbers inside passed array. The second function makes a network call from worker thread.
Additionally we need a web server to serve our javascript files, to avoid CORS error, an easy way to get a web server running is the Web Server for Chrome - Extension
For more info refer https://www.notion.so/nightwing1998/Web-Workers-and-comlink-in-JS-7ee89a912bcb4e90b95094886b802322