Skip to content

feature request: {#await promise then} #6270

@kamholz

Description

@kamholz

Is your feature request related to a problem? Please describe.
If you have a promise whose resolve value you don't care about, you can currently do:

{#await promise} loading... {:then} resolved {/await} 

but with the shorthand you can't do:

{#await promise then} resolved {/await} 

When you don't need to show a loading state, there is no way to omit the variable for the promise's resolve value. This is a fairly common situation, and it would be good to handle it.

Describe the solution you'd like
Support the above syntax where the variable is omitted.

Describe alternatives you've considered
You can work around this by including a variable that you don't use:

{#await promise then done} resolved {/await} 

But this is awkward style and may also cause issues with linters.

How important is this feature to you?
Moderate. It's not a show-stopper because there's a workaround, but it also seems like something Svelte should support, and it shouldn't be very difficult.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions