Comment

Comment by ng12

I don't think this is a compelling example. React would implement this almost identically:

    const Counter = () => {
      const [count, setCount] = React.useState(0)
      return (
        <div>
          <p>You have clicked the button {count} times.</p>
          <button onClick={() => setCount(count => count + 1)}>Increment</button>
        </div>
      )
    }
Replace the atom/swap with a useState hook and it's almost identical.
parent ng12 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton