Skip to content

Commit 99764b2

Browse files
Update src/runtime/action/index.ts
Co-authored-by: Ignatius Bagus <[email protected]>
1 parent 34f7b95 commit 99764b2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/runtime/action/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@
1717
*
1818
* Docs: https://svelte.dev/docs#template-syntax-element-directives-use-action
1919
*/
20-
export type ActionReturn<Parameter = any> = void extends Parameter
21-
? {
22-
destroy?: () => void;
23-
}
24-
: {
25-
update?: (parameter: Parameter) => void;
26-
destroy?: () => void;
27-
}
20+
interface ActionReturn<Parameter = void> {
21+
update?: void extends Parameter ? undefined : (parameter: Parameter) => void;
22+
destroy?: () => void;
23+
}
2824

2925
/**
3026
* Actions are functions that are called when an element is created.

0 commit comments

Comments
 (0)