-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Not implemented Empty
when destructuring an array as an object in markup
#6609
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
Comments
The example in Repl is a bit inappropriate, but the full benefit of such destructuring can be felt when you need to get, for example, the fifth, tenth and fifteenth element of the array and assign it to variables.
|
Much better IMO |
that's invalid code in |
That In the case of svelte markup ATM of course invalid, but it's completely valid javascript |
no
is invalid... beucase what You are doing is where |
Please check out this link if you want to investigate possibilities of javascript |
I think that if svelte imitates javascript in this respect, then it is a proper extension of the idea that has its purpose Link to doc |
Although it's not suitable for each because of the disposability |
I think that |
Therefore, there is no point in continuing the discussion of issue |
Your each was not iterating once, but 3 times. |
The destructuring is done in one iteration, and when the entire array is disposed of across all of its indexes, as specified
I would expect it to be executed once(instead of error). |
The only question that remains is whether the |
Your code was incorrect in way of expectation of what it should do... but I partially agree, syntax was correct, because item (string) was destructable, where it should write 3 time first and last symbol/character in string. So practically this is bug, but it's different bug than that You described. |
Reopen. this destructuring doesn't work even with "valid" iteration |
Error is the same |
I tried to add it to |
This should be fixed in 3.57.0 - https://svelte.dev/repl/d1f832a12ca1455b94cd87f4ef5c1196?version=3.57.0 |
Describe the problem
At the moment, when I destructing array in this way in the markup:
The compiler gives an error
Not implemented Empty
However, this kind of destructuring is 100% valid js as you can see in REPL
Describe the proposed solution
I wish it would work in markup☺️
Alternatives considered
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: