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/reactive-value-dependency-n.../main.svelte

19 lines
332 B

<script>
import { writable } from 'svelte/store';
let store = writable(42);
let variable = 42;
let value;
let value2;
$: value = $store;
$: value2 = variable;
export function updateStore(value) {
store.set(value);
}
export function updateVar(value) {
variable = value;
}
</script>
<p>{ value }</p>
<p>{ value2 }</p>