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

fix: improve object comparison in useHasChanged #1204

Merged

Conversation

ryanhopperlowe
Copy link
Contributor

Signed-off-by: Ryan Hopper-Lowe [email protected]

@ryanhopperlowe ryanhopperlowe requested review from thedadams and ivyjeong13 and removed request for thedadams January 10, 2025 17:01
Comment on lines 47 to 50
if (aKeys.length !== bKeys.length) return false;

return aKeys.every(
(key) => key in b && a[key as keyof T] === b[key as keyof T]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
if (aKeys.length !== bKeys.length) return false;
return aKeys.every(
(key) => key in b && a[key as keyof T] === b[key as keyof T]
return aKeys.length === bKeys.length && aKeys.every(
(key) => key in b && a[key as keyof T] === b[key as keyof T]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated this, and fixed the commit message

@thedadams
Copy link
Contributor

You have this marked as a feat: in your commit message, but this looks more like a fix:.

@ryanhopperlowe ryanhopperlowe changed the title feat: improve object comparison in useHasChanged fix: improve object comparison in useHasChanged Jan 10, 2025
@ryanhopperlowe ryanhopperlowe merged commit 1f4b97b into obot-platform:main Jan 10, 2025
2 checks passed
@ryanhopperlowe ryanhopperlowe deleted the update-use-has-changed branch January 10, 2025 20:56
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

Successfully merging this pull request may close these issues.

2 participants