Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hooks alpha doc] Suggested edits for useSelector documentation #1275

Closed
estaub opened this issue May 2, 2019 · 1 comment
Closed

[hooks alpha doc] Suggested edits for useSelector documentation #1275

estaub opened this issue May 2, 2019 · 1 comment

Comments

@estaub
Copy link

estaub commented May 2, 2019

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.

@timdorr
Copy link
Member

timdorr commented May 2, 2019

See #1267

@timdorr timdorr closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants