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/component-binding-reactive-.../main.svelte

14 lines
296 B

<script>
import Component from './Component.svelte';
export let primitive_updates = 0;
export let object_updates = 0;
const obj = { foo: '' };
let foo = 'bar';
$: if (obj) object_updates++;
$: if (foo) primitive_updates++;
</script>
<Component bind:value={obj.foo} bind:value2={foo} />