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 flatten hack and use lodash #424

Open
emilgoldsmith opened this issue Jul 7, 2018 · 0 comments
Open

Remove flatten hack and use lodash #424

emilgoldsmith opened this issue Jul 7, 2018 · 0 comments

Comments

@emilgoldsmith
Copy link
Member

Expected Behavior

We shouldn't have hacky global prototype overrides ;), also the spec has changed from flatten to flat. (which was the reason no babel plugin was in yet, it was still in discussion)

Current Behavior

Emil (yeah that's me) implemented hacky global prototype overrides, see here

// Emil hacking because he can't find a babel plugin that does it for some reason
if (!Array.prototype.flatten) {
// eslint-disable-next-line
Array.prototype.flatten = function flatten() {
return this.reduce((acc, cur) => acc.concat(cur), []);
};
}

Possible Solution

Just remove the prototypes hacks and use lodash

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