New Equality function type signature breaks with a lot of equality functions
See original GitHub issueThanks for the great library! Just a heads up and something I think worth considering; adding the index to the equality callback causes a lot of commonly used equality functions to break.
For instance the most popular one, shallowEqual
has as a third parameter a custom comparison function: shallowequal(value, other, [customizer], [thisArg])
. Same is true for the lodash deep comparison function.
Of course it is not a huge problem to change this in our code, but it breaks a lot of existing code like this: memoizeOne(params, shallowEqual)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
The Eq type class - CIS194
This class brings equality to the world . Type classes. In last week's homework, you have developed a working implementation of Sokoban.
Read more >Documentation - TypeScript 3.7
For that reason, TypeScript 3.7 introduces a new concept called “assertion signatures” which model these assertion functions. The first type of assertion ...
Read more >Typeclasses: Polymorphism in Haskell - Andrew Gibiansky
A function with that type signature cannot check whether one value of type a is equal to another value of type a !...
Read more >function declaration - JavaScript - MDN Web Docs
The function declaration defines a function with the specified parameters.
Read more >Why does Haskell hide functions with the same name but ...
So Haskell never makes any decisions based on the fact that a given type does not have an instance for a given typeclass....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Based on your feedback I think I will role it back. I’ll have more of a think about how to move forward On Sun, 16 Dec 2018 at 9:35 pm, Alex Reardon alexreardon@gmail.com wrote:
From my perspective, a library should not be aware of the implementation of other libraries
The HOC idea is awesome, but it complicates the usability IMO, I agree we should roll back #42 as it breaks current usage suggested by the README