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

Fix: remove unnecessary arrow function #60

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

ZER0
Copy link
Contributor

@ZER0 ZER0 commented Apr 17, 2018

This arrow function makes Uglify to fails in our project, plus I guess
it wouldn't work in browser that does not support them (as IE11).
Since it seems the only one in the project, and since it's also
unnecessary, I can see only benefits from remove it.

This arrow function makes Uglify to fails in our project, plus I guess
it wouldn't work in browser that does not support them (as IE11).
Since it seems the only one in the project, and since it's also
unnecessary, I can see only benefits from remove it.
@sandstrom
Copy link
Collaborator

sandstrom commented Apr 17, 2018

thanks @ZER0! 🏆

I think this will be undefined in the nested invocation, which won't cause any issues running the current code, but may cause hiccups if the code is changed further down the road.

How about something like this?

var _this = this;
Array.from(el.querySelectorAll('img')).every(function(img) {
  _this.isImageLoaded(img);
});

Edit: Never mind, can't see why we'd ever make that method recursive in the future. Let's go with this!

@sandstrom sandstrom merged commit 623d202 into manuelstofer:master Apr 17, 2018
@ZER0 ZER0 deleted the remove-arrow-function branch April 18, 2018 10:58
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.

None yet

2 participants