3 ms·
> If we were to just call the compute function inside of our Svelte front-end, we would run it in the main thread and lock up the UI, causing a bad user experie
by chrisjj 3y ago
> If we were to just call the compute function inside of our Svelte front-end, we would run it in the main thread and lock up the UI, causing a bad user experience as the webpage would appear frozen. To fix this, we run that code inside of a Web Worker. Doing this will allow us to run the search algorithm in a separate thread so the main thread is available to respond to the user.
I can't see what useful response to the user is possible, given the search results are as yet unavailable.