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

New Equality function type signature breaks with a lot of equality functions #47

Closed
ehtb opened this issue Dec 16, 2018 · 5 comments
Closed

Comments

@ehtb
Copy link

ehtb commented Dec 16, 2018

Thanks 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)

@alexreardon
Copy link
Owner

alexreardon commented Dec 16, 2018 via email

@alexreardon
Copy link
Owner

alexreardon commented Dec 16, 2018 via email

@alexreardon
Copy link
Owner

alexreardon commented Dec 16, 2018 via email

@ehtb
Copy link
Author

ehtb commented Dec 16, 2018

Thanks for the fast reply, makes sense yes.

@nihgwu
Copy link
Contributor

nihgwu commented Dec 17, 2018

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

@alexreardon alexreardon mentioned this issue Dec 17, 2018
alexreardon added a commit that referenced this issue Dec 17, 2018
Closes #47 
Closes #39 

Biting the bullet and changing the api for super flexibility
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

No branches or pull requests

3 participants