-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Description
It seems like the library is currently hardcoded to compare the value produced by the selector using Object.is
use-context-selector/src/index.js
Line 82 in ba7476a
|| Object.is(ref.current.s, ref.current.f(nextValue))) { |
Sometimes it may be useful to use a different equality comparison such as shallow equal when composing an object. The redux useSelector
API has an extra optional parameter for this purpose, which can be used like
const selectedData = useSelector(selectorReturningObject, shallowEqual)
Would you consider supporting this in use-context-selector?
Mesqalito, KiraLT, mikeKlech, iddan, seanblonien and 6 more
Metadata
Metadata
Assignees
Labels
No labels