Description
This is w/r/t https://github.com/reduxjs/react-redux/blob/v7-hooks-alpha/docs/api/hooks.md#useselector
I found the existing doc puzzling. If these edits are factually wrong, then please consider clarifying in that area regardless.
1. Change:
If a deps array is provided, the last saved selector will be used, and that selector will be overwritten whenever the deps array contents have changed.
to something like:
If a dependency array is provided, the selector is saved and reused until a dependency changes.
2. Change:
When an action is dispatched,
useSelector()
will do a shallow comparison of the previous selector result value and the current result value.
to:
If the store has been modified since
useSelector()
was last invoked,useSelector()
does a shallow comparison of the previous and current selector result values.
Again, if the "when an action is dispatched" condition is in fact more informative in some way, please clarify.