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-invalidation-while-up.../main.svelte

21 lines
352 B

<script>
import {writable} from 'svelte/store';
function action(node, binding) {
return {
update: (value) => s.set(value),
}
}
let s = writable("simple");
let v = "";
function click() {
s.set('clicked');
}
</script>
<div>{v}</div>
<div>{$s}</div>
<input bind:value={v} use:action={v}>
<button on:click={click}>click me</button>