svelte/documentation/examples/07-stores/00-writable-stores/Decrementer.svelte

10 lines
158 B

<script>
import { count } from './stores.js';
function decrement() {
count.update((n) => n - 1);
}
</script>
<button on:click={decrement}> - </button>