Skip to content

Commit 5a963d1

Browse files
committed
defer to the reference documentation
1 parent 09da021 commit 5a963d1

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

documentation/docs/03-template-syntax/[email protected]

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,4 @@ To add attachments to an object that will be spread onto a component or element,
163163

164164
## Converting actions to attachments
165165

166-
If you want to use this functionality on components but you are using a library that only provides actions you can use the [`fromAction`](svelte-attachments#fromAction) utility.
167-
168-
This function accept an action as the first argument and a function returning the arguments of the action as the second argument and returns an attachment.
169-
170-
```svelte
171-
<script>
172-
import Button from "./Button.svelte";
173-
import { log } from "log-my-number";
174-
import { fromAction } from "svelte/attachments";
175-
176-
let count = $state(0);
177-
</script>
178-
179-
<Button
180-
onclick={() => count++}
181-
{@attach fromAction(log, () => count)}
182-
>
183-
{count}
184-
</Button>
166+
If you're using a library that only provides actions, you can convert them to attachments with [`fromAction`](svelte-attachments#fromAction), allowing you to (for example) use them with components.

0 commit comments

Comments
 (0)