-
Notifications
You must be signed in to change notification settings - Fork 405
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
refactor(store): use Object.is
as default equality check
#2245
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 3daaa81. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
@ngxs/devtools-plugin
@ngxs/form-plugin
@ngxs/hmr-plugin
@ngxs/router-plugin
@ngxs/storage-plugin
@ngxs/store
@ngxs/websocket-plugin
commit: |
BundleMonFiles updated (1)
Unchanged files (5)
Total files change -348B -0.26% Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (9)
No change in files bundle size Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (Integration Projects)Files updated (3)
Total files change -127B -0.06% Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find!!!
(<any>memoized).reset = function () { | ||
// The hidden (for now) ability to reset the memoization | ||
lastArgs = null; | ||
lastResult = null; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of this function is unrelated to this PR.
And besides, what is the motivation to remove it?
PS. The PR also requires an update to the changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove it in another PR, but that part should not be included in the code unless it’s ever used. Extra work is bad, so unless there’s a valid argument for including that extra code, it shouldn’t be there.
In this commit, we default to using `Object.is` as the equality check function (this function is also used by other frameworks). `Object.is` supports checking for `NaN` values internally. We have also removed the reset function, as it was unused. If needed in the future, it can be re-added.
9162c3a
to
3daaa81
Compare
Code Climate has analyzed commit 3daaa81 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 95.3% (-0.1% change). View more on Code Climate. |
In this commit, we default to using
Object.is
as the equality check function (this function is also used by other frameworks).Object.is
supports checking forNaN
values internally. We have also removed the reset function, as it was unused. If needed in the future, it can be re-added.