mirror of https://github.com/sveltejs/svelte
parent
0d8bafa690
commit
fdbf2d5146
@ -1,15 +1,13 @@
|
||||
<script>
|
||||
export const count1 = $state.frozen({value: 0});
|
||||
export const count2 = $state({value: 0});
|
||||
|
||||
export function increment() {
|
||||
count2.value += 1;
|
||||
}
|
||||
let count = $state(0);
|
||||
let doubled = $derived(count * 2);
|
||||
|
||||
</script>
|
||||
export { count, doubled };
|
||||
|
||||
{count1.value}
|
||||
{count2.value}
|
||||
export function increment() {
|
||||
count += 1;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- so that count1/2 become sources -->
|
||||
<svelte:options accessors />
|
||||
{count}
|
||||
{doubled}
|
||||
|
||||
Loading…
Reference in new issue