Skip to content
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

Remove unnecessary spread operator #12

Merged
merged 1 commit into from
Sep 24, 2020
Merged

Remove unnecessary spread operator #12

merged 1 commit into from
Sep 24, 2020

Conversation

dkniffin
Copy link
Contributor

Fixes #11

@dkniffin
Copy link
Contributor Author

@osvaldasvalutis Would you mind taking a look at this and merging it? Thanks!

@osvaldasvalutis
Copy link
Contributor

osvaldasvalutis commented Sep 24, 2020

@dkniffin the spread operator here converts NodeList to Array which allows to run forEach on older browsers (e.g. IE).

@dkniffin
Copy link
Contributor Author

@osvaldasvalutis Ah, ok. I'll switch to Array.from. Will that be okay?

@osvaldasvalutis
Copy link
Contributor

@dkniffin what's the reasoning behind that?

@dkniffin
Copy link
Contributor Author

@osvaldasvalutis I described the issue over on #11, but in summary, the spread operator combined with the querySelectorAll intermittently has issues on some browsers (the ones we're seeing reports for are Chrome 84 & 85 on Windows, but it's hard to reproduce). I would expect Babel to resolve any issue like that, but it seems it doesn't. There's a similar issue here: babel/babel#10509

@osvaldasvalutis osvaldasvalutis merged commit 0fb2348 into oddcamp:master Sep 24, 2020
@dkniffin dkniffin deleted the patch-1 branch September 24, 2020 17:53
@osvaldasvalutis
Copy link
Contributor

@dkniffin 👌 https://github.com/kollegorna/cocoon-vanilla-js/releases/tag/v1.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Invalid attempt to spread non-iterable instance
2 participants