3 ms·
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 sve
by jameshart 3y ago
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.