Urgent.News

What's breaking now, across thousands of outlets.

Tech

Async Svelte: Using await Directly in Your Components

Every Svelte codebase eventually grows a little pile of scaffolding around asynchronous data. A let data = $state(null) , an $effect that fetches and assigns, a loading flag, an error flag, and a {#if loading} in the template. Or the {#await} block, which is fine for one promise but nests badly the moment you need two. Either way, you end up writing plumbing rather than describing your UI. Since…

We haven't written up this one. Dev.to has the full story — the link below goes straight to it.

Read the original at dev.to →

More in Tech

Delta E is a distance, not a score

I run a game where you get a brand name — Spotify, IKEA, Home Depot — and rebuild its primary color from memory with three sliders: hue, saturation, lightness. On submit, the guess and the target both go to CIE Lab and the score comes from the distance between them. The scoring line was this: const score = Math .

More from Monday 31 August →