-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Await Destructuring #1851
Labels
Comments
+1 |
Also consider destructuring multiple resolved values when using Promise.all: {#await Promise.all([promiseOne, promiseTwo])}
Loading...
{:then [firstValue, secondValue]}
...
{/await} |
@dovca that comes free! Promise.all returns a promise of an array, so destructuring that would work correctly |
In 3.20.0, you can now destructure in await blocks! 🎉 |
With destructuring brokes the scope of destructed variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
#await
blocks do not support destructuring in thethen
andelse
clauses.It would be helpful, especially when dealing with API results with extra wrappers around stuff, to allow destructuring there:
The text was updated successfully, but these errors were encountered: