-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
support destructuring, spread of all iterables, not just arrays #1059
Comments
It should also be possible to spread arbitrary iterables, not just arrays: const set = new Set([1, 2, 3]);
console.log(...set); // 1, 2, 3
|
Meanwhile, any workarounds to ignore this issue for spread with set? |
I'm a few months late, but a workaround is to wrap all iterables (set, map, generator, string, custom iterables) in |
Another example, but DOM NodeList should also be supported: [...document.querySelectorAll('img')].forEach(node => node.remove()) |
Any idea about the roadmap for this improvement? |
It looks like this works now: https://flow.org/try/#0MYewdgzgLgBAHjAvDMBTA7jAyqqAKAbQEYAaGAJjIGYBdASgG4AoUSWATyRgIDo+4azJnnYEADDQBcKAK4BbAEaoATo2GiJ06MoCWYAOZqgA Let me know if this is still an issue 👍 |
@calebmer that looks like a particular case of destructuring - it looks like destructuring assignments still don't work: https://flow.org/try/#0PQKhCgAIUgBAzANgewO6QM4BcBOBLAYyyhGHHABMBTAxAQxysgDcGWAuSASSypzoBGiKgB5s+AHYBzAHwBucgWQTskANrw8ObAF1IAXhYKlKrOoB0lxroNHwACk3asncXmkBKBfesvMudyk1HS9wIA Opened as new ticket #8375 |
With the above code, I expect there to be no errors, and each binding
a
,b
,c
should benumber
.Today, I get the following errors:
relevant spec text.
The text was updated successfully, but these errors were encountered: