Last active
July 15, 2021 22:41
-
-
Save cabreraalex/69195baaad8f2d9ed4f1971201c35bda to your computer and use it in GitHub Desktop.
widget-svelte-example App.svelte unit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { value, count } from './stores'; | |
let localValue = $value; | |
</script> | |
<style> | |
h1 { | |
color: purple; | |
} | |
</style> | |
<h1>The value is: {$value} x {$count}</h1> | |
<input bind:value={localValue} /> | |
<button on:click={() => value.set(localValue)}>Set Value</button> | |
<button on:click={() => count.update(d => d + 1)}>Update count</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 16 should be:
<button on:click={() => count.update(d => d+1)}>Update count</button>