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: content/tutorial/01-svelte/04-logic/06-await-blocks/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,21 @@ Most web applications have to deal with asynchronous data at some point. Svelte
6
6
7
7
```svelte
8
8
/// file: App.svelte
9
-
{#await promise}
9
+
+++{#await promise}+++
10
10
<p>...waiting</p>
11
-
{:then number}
11
+
+++{:then number}
12
12
<p>The number is {number}</p>
13
13
{:catch error}
14
14
<p style="color: red">{error.message}</p>
15
-
{/await}
15
+
{/await}+++
16
16
```
17
17
18
18
> Only the most recent `promise` is considered, meaning you don't need to worry about race conditions.
19
19
20
20
If you know that your promise can't reject, you can omit the `catch` block. You can also omit the first block if you don't want to show anything until the promise resolves:
0 commit comments