Hacker News new | ask | show | jobs
by asattarmd 1911 days ago
It's "just javascript" because if you want to modify anything and have it re-render, it's `let counter = 0; counter++`, not `const [counter, setCounter] = useState(0); setCounter(counter + 1); `. Of course there's template and all, but for regular logic, you don't have to fiddle around abstractions.
1 comments

You think that it‘s just reassignment in svelte? I don‘t think so.

Counter in this example is likely a proxy object that knows when it‘s changed and tells svelte to re-render.

It‘s also not immutable, which can cause very confusing interactions in global state.