document await...catch shorthand (#5682)

pull/5704/head
swyx 4 years ago committed by GitHub
parent 02e560c9da
commit e750b7284e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -300,6 +300,9 @@ An each block can also have an `{:else}` clause, which is rendered if the list i
```sv
{#await expression then name}...{/await}
```
```sv
{#await expression catch name}...{/await}
```
---
@ -342,6 +345,16 @@ If you don't care about the pending state, you can also omit the initial block.
{/await}
```
---
If conversely you only want to show the error state, you can omit the `then` block.
```sv
{#await promise catch error}
<p>The error is {error}</p>
{/await}
```
### {#key ...}
```sv

Loading…
Cancel
Save