Skip to content

Use shallowEqual and isEmpty as much as possible#540

Merged
itsmichaeldiego merged 6 commits intomasterfrom
shallow-compare-objects
Mar 13, 2018
Merged

Use shallowEqual and isEmpty as much as possible#540
itsmichaeldiego merged 6 commits intomasterfrom
shallow-compare-objects

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

Comments