4 ms·
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] = useSt
by asattarmd 6y 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.
- j-krieger 6y agoYou 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.