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
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
TypeScript code in worker-client.ts. It creates a Web Worker from './worker.ts', a Map called pending from number to PromiseWithResolvers<string>, and a counter nextId = 0. A function ask(text) takes the next id, creates a request with Promise.withResolvers<string>() (highlighted), stores it in pending under that id, posts { id, text } to the worker and returns request.promise. In worker.onmessage, the handler reads id and result from event.data, calls pending.get(id)?.resolve(result) (highlighted) and deletes the id from pending. Last line: const answers = await Promise.all([ask('hello'), ask('world')]).
Terminal comparison of three Vitest 5.1 runs on a small test project. Run 1, "vitest run": 6 test files, 2 failed (t3 and t6), 4 passed. Run 2 after fixing t3, "vitest run --last-failed": only 2 files run, t3 now passes, t6 still fails. Run 3, "vitest run --last-failed" again: only t6 runs (1 file). Caption: the selection shrinks as you fix tests.
Load more