Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
?Unknown authorNov 11, 2026, 12:45 PM

It is inevitable that at some point you will work with some large quantity of data in the frontend (oops, spoilers for today's livestream 😅)

Reach for Web Workers when this happens, pair them with resources, and you're good to go:

#Angular #WebWorkers #JavaScript #WebDev

Angular TypeScript code in a dark editor tab named product-search.ts. First, search.worker.ts: a message listener that runs searchProducts on the incoming data and posts the result back on ports[0]. Then a helper, runInWorker, that creates a new MessageChannel, posts the data to the worker together with port2 (highlighted), and returns a Promise that resolves when port1 receives the answer. Then a ProductSearch component: its template has an input that sets the query signal and a @for loop over results.value() showing each product name. The class creates the worker with new Worker(new URL('./search.worker', import.meta.url)) (highlighted), a query signal, and a results resource with params set to the query and a loader that calls runInWorker with the worker and the params (highlighted).