Skip to content

Commit feb2d85

Browse files
docs: clarify why we need to use the derived rune (#13919)
* clarify why we need to use the derived rune * put clarification as note
1 parent 107be28 commit feb2d85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ The expression inside `$derived(...)` should be free of side-effects. Svelte wil
2121

2222
As with `$state`, you can mark class fields as `$derived`.
2323

24+
> [!NOTE] Code in Svelte components is only executed once at creation, without the `$derived` rune `double` would maintain it's original value.
25+
2426
## `$derived.by`
2527

2628
Sometimes you need to create complex derivations that don't fit inside a short expression. In these cases, you can use `$derived.by` which accepts a function as its argument.

0 commit comments

Comments
 (0)