It seems like the library is currently hardcoded to compare the value produced by the selector using Object.is
|
|| 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?
It seems like the library is currently hardcoded to compare the value produced by the selector using
Object.isuse-context-selector/src/index.js
Line 82 in ba7476a
Sometimes it may be useful to use a different equality comparison such as shallow equal when composing an object. The redux
useSelectorAPI has an extra optional parameter for this purpose, which can be used likeWould you consider supporting this in use-context-selector?