|
|
|
@ -7,7 +7,7 @@ At the heart of Svelte is a powerful system of *reactivity* for keeping the DOM
|
|
|
|
|
To demonstrate it, we first need to wire up an event handler. Replace line 9 with this:
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
<button on:click={handleClick}>
|
|
|
|
|
<button on:click={handleClick}/>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Inside the `handleClick` function, all we need to do is change the value of `count`:
|
|
|
|
@ -18,4 +18,4 @@ function handleClick() {
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Svelte 'instruments' this assignment with some code that tells it the DOM will need to be updated.
|
|
|
|
|
Svelte 'instruments' this assignment with some code that tells it the DOM will need to be updated.
|
|
|
|
|