News for hackers. Stuff that matters.
Re:Svelte 5: Runes by jameshart on Wednesday September 20, 2023 @11:22AM (#37585355)
Functions can return primitives, so there’s nothing wrong with $state() returning a number that you can +=1.

What is weird is that it’s actually typed as a svelte-compiler-only ‘extended int’ that can have side effects when you increment it, and weird knock on results from reading it.

There are no comments on this comment yet.