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

Remove unnecessary RootState typing when calling useAppSelector #1029

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

nelsonni
Copy link
Member

@nelsonni nelsonni commented Dec 7, 2022

Description:

To adhere to best practices, as described in Usage with TypeScript, this PR updates the call signature for all invocations of useAppSelector to remove unnecessary RootState typings using the following pattern:

+  const new = useAppSelector(state => cardSelectors.selectById(state, cardId));
-  const old = useAppSelector((state: RootState) => cardSelectors.selectById(state, cardId));

This PR resolves #995, and signifies the following version changes (per Semantic Version):

  • PATCH version increase

Changes:

This PR makes the following changes:

Checklist:

Before submitting this PR, I have verified that my code:

  • Resides on a fix/ or feature/ branch that was initially branched off from development.
  • Passes code linting (yarn lint) and unit testing (yarn test).
  • Successfully builds a distribution package (yarn package).
  • I have read and am aware of the CONTRIBUTING guide for this project.
  • My name is listed in the Contributors section, or this PR includes a request to add my name.

@nelsonni nelsonni added the feature Feature requests or improvements label Dec 7, 2022
@nelsonni nelsonni merged commit 9867b4c into main Dec 7, 2022
@nelsonni nelsonni deleted the fix/removeRootStateTypes branch December 7, 2022 05:52
@nelsonni nelsonni self-assigned this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unnecessary RootState typing when using useAppSelector
1 participant