Closed otakustay closed 5 years ago
You can already use reselector (or any other) selectors with redux-react-hook. We shouldn't expand the scope of redux-react-hook
to include selectors. Especially since not everyone uses the same selector library or the same configurations of reselect for that matter. This would be a perfect use case for a custom hook.
When state is mapped to an object or array like:
The returning
users
can be a new array instance each time this component renders, passingusers
to a sub component could cause a re-render evenuserIds
anduserStore
are not modified.I'd rather to provide a more reselect like API:
In which the values returned by the second argument become dependencies to a
useMemo
call.