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

Unnecessary code in populateTeamData? #87

Open
tbtommyb opened this issue Mar 31, 2017 · 0 comments
Open

Unnecessary code in populateTeamData? #87

tbtommyb opened this issue Mar 31, 2017 · 0 comments

Comments

@tbtommyb
Copy link

First of all, I like that you gave the holder object in this file a useful name and that the names of the methods map to the tables they're changing.

Can you explain the reason for using the len variable in populateTeams.team? I have seen another team do something similar and I don't see why you can't just put the final call to cb outside of the forEach loop. If it's because you need the id variable that's in scope of the callback then you could just assign it to an outer variable.

I like your general approach of building up the user teams, though I think that a combination of map and filter would be easier to read on line 71.

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

No branches or pull requests

1 participant