<script>
let count = 0
</script>
<button on:click={()=>count--}>decrement</button>
<span>{count}</span>
<button on:click={()=>count++}>increment</button>
<button on:click={()=>setTimeout(()=>count++, 1000)}>
increment later
</button>
Play with this in the Svelte REPL here: https://svelte.dev/repl/97d42ad98e4b4a929d3c5a3de880e6fc?ver...Doing this, I also realized rubymamis cheated a good bit on their QML version. It's missing the text for the buttons. It's not wrapped in `ApplicationWindow { }`. And there's a bug with their implementation: If you clicked their "increment later" button many times quickly then it would keep resetting the timer and only increment once.