diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 119488aacc..ac7ca7abf3 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -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} +

The error is {error}

+{/await} +``` + ### {#key ...} ```sv