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

Verify that selector and equalityF of useSelector are functions #1706

Merged
merged 1 commit into from Mar 31, 2021

Conversation

gshilin
Copy link
Contributor

@gshilin gshilin commented Mar 31, 2021

As discussed in #1704 added a couple of dev-only checks to useSelector to verify that both selector and equalityFn are functions

@netlify
Copy link

netlify bot commented Mar 31, 2021

Deploy preview for react-redux-docs ready!

Built with commit bd42e4a

https://deploy-preview-1706--react-redux-docs.netlify.app

}
if (typeof equalityFn !== 'function') {
throw new Error(
`You must pass a function as an equality function to useSelector`
Copy link
Member

Choose a reason for hiding this comment

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

Not going to lie, I would love to add a little sass on this one:

Suggested change
`You must pass a function as an equality function to useSelector`
`You must pass a _function_ as an equality _function_ to useSelector...`

(Note, please don't merge this :P)

@timdorr
Copy link
Member

timdorr commented Mar 31, 2021

LGTM 👍

@timdorr timdorr merged commit df36f4e into reduxjs:master Mar 31, 2021
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.

None yet

2 participants