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

Add 'objectValues' JS util function #1209

Merged
merged 1 commit into from
Jan 27, 2018
Merged

Conversation

IvanGoncharov
Copy link
Member

Following pattern are frequently used in this lib:

const objMap = ...
Object.keys(objMap).map(name => {
  const item = objMap[name];
  // ...
})

It can be greatly simplify with Object.values however Flow can't hadle it well and IE doesn't implement it.
This PR adds objectValues substitution to use until we could switch to Object.values.

Plus it should give small performance boost from using native Object.values when possible.

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

Successfully merging this pull request may close these issues.

3 participants