Skip to content

Use shallowEqual and isEmpty as much as possible #540

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

Merged
merged 6 commits into from
Mar 13, 2018

Conversation

itsmichaeldiego
Copy link
Member

PR #440 Inspired me to use shallowCompare as much as possible to compare objects, mostly between props and nextProps or prevProps.

Also, we were doing many checks by !== undefined or === undefined, where we could just check with isEmpty, who also checks for the object being an empty string ('') or null. Which makes the code more solid.

@itsmichaeldiego itsmichaeldiego self-assigned this Mar 13, 2018
@itsmichaeldiego itsmichaeldiego changed the title Use shallowCompare and isEmpty as much as possible Use shallowEqual and isEmpty as much as possible Mar 13, 2018
@itsmichaeldiego itsmichaeldiego merged commit 486bccf into master Mar 13, 2018
@itsmichaeldiego itsmichaeldiego deleted the shallow-compare-objects branch March 13, 2018 23:59
@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant