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
281 B

<script>
import { writable } from '../../../../store';
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>