From 61474e7685dc501874ebfea5e07d64d3f7e776e9 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Wed, 21 May 2025 12:13:41 +0100 Subject: [PATCH] docs: mention update method on svelte-action page --- documentation/docs/03-template-syntax/12-use.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/docs/03-template-syntax/12-use.md b/documentation/docs/03-template-syntax/12-use.md index 45de023578..57c006672a 100644 --- a/documentation/docs/03-template-syntax/12-use.md +++ b/documentation/docs/03-template-syntax/12-use.md @@ -39,6 +39,7 @@ An action can be called with an argument: ``` The action is only called once (but not during server-side rendering) — it will _not_ run again if the argument changes. +However, the action _can_ [return an object](./svelte-action#ActionReturn) containing an `update` method that will be run when the argument changes. > [!LEGACY] > Prior to the `$effect` rune, actions could return an object with `update` and `destroy` methods, where `update` would be called with the latest value of the argument if it changed. Using effects is preferred.