Skip to content

Instantly share code, notes, and snippets.

@martinschnurer
Created December 6, 2020 23:46
Show Gist options
  • Save martinschnurer/1b83be39efabf7d180ceb079cb8a702c to your computer and use it in GitHub Desktop.
Save martinschnurer/1b83be39efabf7d180ceb079cb8a702c to your computer and use it in GitHub Desktop.
// this selector now returns values wrapped in the object
// so you would need to write equality checkers as the second argument in the useSelector function
const usersCountObj = useSelector(state => {
return {
users: state.users,
userCount: state.users.length
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment