File tree 1 file changed +17
-20
lines changed
packages/svelte/tests/runtime-runes/samples/derived-unowned
1 file changed +17
-20
lines changed Original file line number Diff line number Diff line change 1
1
<script context =" module" >
2
2
class Foo {
3
- x = $state (5 );
4
- y = $derived (this .x * 2 );
5
- }
6
- const foo = new Foo ();
3
+ x = $state (5 );
4
+ y = $derived (this .x * 2 );
5
+ }
6
+ const foo = new Foo ();
7
7
8
- let x = $state (2 );
9
- let y = $derived (x * 2 );
10
- const bar = {
11
- get x () {
12
- return x;
13
- },
14
- set x (val ) {
15
- x = val;
16
- },
17
-
18
- get y () {
19
- return y;
20
- },
21
- };
8
+ let x = $state (2 );
9
+ let y = $derived (x * 2 );
10
+ const bar = {
11
+ get x () {
12
+ return x;
13
+ },
14
+ set x (val ) {
15
+ x = val;
16
+ },
22
17
18
+ get y () {
19
+ return y;
20
+ },
21
+ };
23
22
</script >
24
23
25
24
<button onclick ={() => foo .x ++ }>
@@ -29,5 +28,3 @@ const bar = {
29
28
<button onclick ={() => bar .x ++ }>
30
29
x: {bar .x }, y: {bar .y }
31
30
</button >
32
-
33
- <svelte:options runes />
You can’t perform that action at this time.
0 commit comments