You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md
+12-10Lines changed: 12 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -134,27 +134,29 @@ If the value of a reactive variable is being computed it should be replaced with
134
134
```
135
135
...`double` will be calculated first despite the source order. In runes mode, `triple` cannot reference `double` before it has been declared.
136
136
137
-
###`$derived.call`
137
+
## `$derived.call`
138
138
139
-
Sometimes you need to create complex derivations which don't fit inside a short expression. In this case, you can resort to `$derived.call` which accepts a function as its argument and returns its value.
139
+
Sometimes you need to create complex derivations that don't fit inside a short expression. In these cases, you can use `$derived.call` which accepts a function as its argument.
In essence, `$derived(expression)` is equivalent to `$derived.call(() => expression)`.
159
+
158
160
## `$effect`
159
161
160
162
To run side-effects like logging or analytics whenever some specific values change, or when a component is mounted to the DOM, we can use the `$effect` rune:
0 commit comments