You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md
+55-15Lines changed: 55 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,12 @@ import {
28
28
29
29
## afterUpdate
30
30
31
+
<blockquoteclass="tag deprecated">
32
+
33
+
Use `$effect` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate
34
+
35
+
</blockquote>
36
+
31
37
Schedules a callback to run immediately after the component has been updated.
32
38
33
39
The first time the callback runs will be after the initial `onMount`.
@@ -42,8 +48,16 @@ function afterUpdate(fn: () => void): void;
42
48
43
49
</div>
44
50
51
+
52
+
45
53
## beforeUpdate
46
54
55
+
<blockquoteclass="tag deprecated">
56
+
57
+
Use `$effect.pre` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate
58
+
59
+
</blockquote>
60
+
47
61
Schedules a callback to run immediately before the component is updated after any state change.
48
62
49
63
The first time the callback runs will be before the initial `onMount`.
@@ -58,8 +72,16 @@ function beforeUpdate(fn: () => void): void;
58
72
59
73
</div>
60
74
75
+
76
+
61
77
## createEventDispatcher
62
78
79
+
<blockquoteclass="tag deprecated">
80
+
81
+
Use callback props and/or the `$host()` rune instead — see https://svelte-5-preview.vercel.app/docs/deprecations#createeventdispatcher
82
+
83
+
</blockquote>
84
+
63
85
Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).
64
86
Event dispatchers are functions that can take two arguments: `name` and `detail`.
65
87
@@ -88,6 +110,8 @@ function createEventDispatcher<
88
110
89
111
</div>
90
112
113
+
114
+
91
115
## createRawSnippet
92
116
93
117
Create a snippet programmatically
@@ -105,6 +129,8 @@ function createRawSnippet<Params extends unknown[]>(
105
129
106
130
</div>
107
131
132
+
133
+
108
134
## flushSync
109
135
110
136
Synchronously flushes any pending state changes and those that result from it.
0 commit comments