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
Is your feature request related to a problem? Please describe.
I'm trying to only catch errors on a promise, and to do so I'm forced to do {#await promise}{:catch error} (my code) {/await}
Describe the solution you'd like
Like the {#await promise then result} short-hand, I would love a {#await promise catch error} short-hand.
How important is this feature to you?
I'm trying to figure out a pattern for my Svelte routes that involves doing something like
constgotGroup=need('group',groupId)// this is a promise
$: group=$groups[groupId]
and then, in different parts of the code, I might want to catch an error, but not show anything while it's loading, and don't get the result either because I'm getting that from the store:
{#awaitgotGroup}{:catcherror}
{error}
{/await}
Additional context
Svelte compiler throws a warning because of an {#await} block being empty when doing {#await promise}{:catch error}
A question I have, separate from this feature and about the {#await} block, is if it's possible to use inside of class= or any other prop inside an element (class="{#await promise}loading{/await}"). If it's not, what's the alternative? I don't want to repeat code for the two paths.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm trying to only catch errors on a promise, and to do so I'm forced to do
{#await promise}{:catch error} (my code) {/await}
Describe the solution you'd like
Like the
{#await promise then result}
short-hand, I would love a{#await promise catch error}
short-hand.How important is this feature to you?
I'm trying to figure out a pattern for my Svelte routes that involves doing something like
and then, in different parts of the code, I might want to catch an error, but not show anything while it's loading, and don't get the result either because I'm getting that from the store:
Additional context
Svelte compiler throws a warning because of an
{#await}
block being empty when doing{#await promise}{:catch error}
A question I have, separate from this feature and about the
{#await}
block, is if it's possible to use inside ofclass=
or any other prop inside an element (class="{#await promise}loading{/await}"
). If it's not, what's the alternative? I don't want to repeat code for the two paths.The text was updated successfully, but these errors were encountered: