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/packages/svelte/tests/runtime-runes/samples/class-private-state-proxy/main.svelte

17 lines
271 B

<script>
class Counter {
#count = $state();
constructor(v) {
this.#count = v;
}
get count() {
return this.#count;
}
}
const counter = new Counter({ count: 0 });
</script>
<button on:click={() => counter.count.count++}>{counter.count.count}</button>