You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/store-assignment-updates-re.../main.svelte

20 lines
284 B

<script>
import { writable } from '../../../../store.js';
const a = writable();
const b = writable();
export let c;
$: $a = $b;
$: $b = $c;
function increment() {
$c += 1;
}
</script>
<p>a: {$a}</p>
<p>b: {$b}</p>
<p>c: {$c}</p>
<button on:click={increment}>+1</button>