Basically, Web Workers ๐ค
This fairly trivial project seeks to be a pleasant welcome for newcomers to the world of Web Workers, showing what they do: in code, and in a demo, as well as highlighting potential use cases and pitfalls. You can either see it live or clone it yourself and open index.html
in a http-server or something similar. Wooooooo!
The project is basically a GIF of this boss dropping a mic, that presents two buttons that both do incredibly expensive calculations. One button does it in the browser, blocking the webpage (DOM) and effectively pausing things, leading to jank and unpleasantness. The other button delegates the calculation to a Web Worker, leaving the DOM nice and interactive.
This is literally just meant to be a POC and nothing too serious.
THE SOURCE CODE IS NOT SCARY! Go through it. Start in client.js and go from there. Really, I'd say there are 3 relevant files: index.html for the structure, client.js for the actual execution, and worker.js to show you how easy workers really are. GO READ IT'S FUN REALLY!