mirror of https://github.com/sveltejs/svelte
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.
20 lines
284 B
20 lines
284 B
6 years ago
|
<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>
|