From 1ed918202533df9891e8ab22b3bc1041a66bae60 Mon Sep 17 00:00:00 2001 From: Ravi van Rooijen Date: Thu, 19 Oct 2023 09:27:47 +0200 Subject: [PATCH] docs: mention `{#await}` on non-Promise values short-circuiting to the fullfilled branch (#9324) Fixes #9323 --- documentation/docs/02-template-syntax/03-logic-blocks.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/documentation/docs/02-template-syntax/03-logic-blocks.md b/documentation/docs/02-template-syntax/03-logic-blocks.md index 98bfc3ea1853..af47f6dfa7af 100644 --- a/documentation/docs/02-template-syntax/03-logic-blocks.md +++ b/documentation/docs/02-template-syntax/03-logic-blocks.md @@ -152,14 +152,16 @@ Since Svelte 4 it is possible to iterate over iterables like `Map` or `Set`. Ite {#await expression catch name}...{/await} ``` -Await blocks allow you to branch on the three possible states of a Promise — pending, fulfilled or rejected. In SSR mode, only the pending state will be rendered on the server. +Await blocks allow you to branch on the three possible states of a Promise — pending, fulfilled or rejected. +In SSR mode, only the pending branch will be rendered on the server. +If the provided expression is not a Promise only the fulfilled branch will be rendered, including in SSR mode. ```svelte {#await promise}

waiting for the promise to resolve...

{:then value} - +

The value is {value}

{:catch error}