diff --git a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md index d8da797c7e..8b29478006 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md +++ b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md @@ -168,6 +168,24 @@ In rare cases, you may need to run code _before_ the DOM updates. For this we ca Previously, you would have used `beforeUpdate`, which — like `afterUpdate` — is deprecated in Svelte 5. +## `$effect.active` + +The `$effect.active` rune is an advanced feature that tells you whether or not the code is running inside an effect or inside your template: + +```svelte + + +
in template: {$effect.active()}
+``` + +This allows you to (for example) add things like subscriptions without causing memory leaks, by putting them in child effects. + ## `$props` To declare component props, use the `$props` rune: