Replies: 1 comment
-
|
Hi, I will skip this suggestion because:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Comparing two objects using
JSON.stringifyhas 2 drawbacks:fast-deep-equaland added equality functions usingJSON.stringifyand the stringify function fromfast-json-stable-stringifyto the benchmark. You can see some of the results below:{ required: true, min: true }and{ min: true, required: true }are considered different values. With a library likefast-deep-equalorfast-equals, they would be considered the same.Proposed solution
Instead of using the current equality function which uses
JSON.stringifyto check if two values are equal, use something likefast-deep-equalto check.I can create a PR to do this. But, it will add a dependency. So, I wanted to reach out and see if this is something you would be interested in changing before going any further.
Alternatives considered
We could pipe the
errors$observable likeerrors$.pipe(distinctUntilChanged(fastDeepEqual). But, that would still run them through theJSON.stringifyequality function, negating the speed benefit.Do you want to create a pull request?
Yes
Beta Was this translation helpful? Give feedback.
All reactions