Actions can return an object containing the two properties defined in this interface. Both are optional.
update: An action can have a parameter. This method will be called whenever that parameter changes,
immediately after Svelte has applied updates to the markup. ActionReturn and ActionReturn<undefined> both
mean that the action accepts no parameters.
destroy: Method that is called after the element is unmounted
Additionally, you can specify which additional attributes and events the action enables on the applied element.
This applies to TypeScript typings only and has no effect at runtime.
Actions can return an object containing the two properties defined in this interface. Both are optional.
ActionReturn
andActionReturn<undefined>
both mean that the action accepts no parameters.Additionally, you can specify which additional attributes and events the action enables on the applied element. This applies to TypeScript typings only and has no effect at runtime.
Example usage:
Docs: https://svelte.dev/docs/svelte-action