Skip to content

Await Destructuring #1851

@Crisfole

Description

@Crisfole

Currently #await blocks do not support destructuring in the then and else clauses.

It would be helpful, especially when dealing with API results with extra wrappers around stuff, to allow destructuring there:

{#await promise}
  Loading...
{:then {prop1, prop2: { items } }}
  Prop1: {prop1}
  {#each items as i}{i}{/each}
{:catch e}
Boo {e}
{/await}

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