Skip to content

Commit e5e6c0c

Browse files
authored
fix docs (#16409)
* fix docs * oops * another * gah
1 parent b17557c commit e5e6c0c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

documentation/docs/02-runes/03-$derived.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,16 @@ let selected = $derived(items[index]);
9999
If you use destructuring with a `$derived` declaration, the resulting variables will all be reactive — this...
100100

101101
```js
102+
function stuff() { return { a: 1, b: 2, c: 3 } }
103+
// ---cut---
102104
let { a, b, c } = $derived(stuff());
103105
```
104106

105107
...is roughly equivalent to this:
106108

107109
```js
110+
function stuff() { return { a: 1, b: 2, c: 3 } }
111+
// ---cut---
108112
let _stuff = $derived(stuff());
109113
let a = $derived(_stuff.a);
110114
let b = $derived(_stuff.b);

documentation/docs/98-reference/.generated/client-errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ $effect(() => {
109109
The same applies to array mutations, since these both read and write to the array:
110110

111111
```js
112-
let array = $state([]);
112+
let array = $state(['hello']);
113113

114114
$effect(() => {
115-
array.push('hello');
115+
array.push('goodbye');
116116
});
117117
```
118118

packages/svelte/messages/client-errors/errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ $effect(() => {
7979
The same applies to array mutations, since these both read and write to the array:
8080

8181
```js
82-
let array = $state([]);
82+
let array = $state(['hello']);
8383

8484
$effect(() => {
85-
array.push('hello');
85+
array.push('goodbye');
8686
});
8787
```
8888

0 commit comments

Comments
 (0)