-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make action helpers use the dispatch(actionCreator()) pattern #9341
Conversation
@@ -95,7 +95,7 @@ export type DeploymentsState = { | |||
}; | |||
|
|||
function useDeployments(): DeploymentsState { | |||
const dispatch = useDispatch<Dispatch>(); | |||
const dispatch = useDispatch<AsyncDispatch>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redux Toolkit recommends exporting a global const useThunkDispatch = () => useDispatch<typeof store.dispatch>();
I personally prefer to follow this pattern instead, but I'm open to different opinions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I slightly prefer redux toolkit's recommendation, but not by much. I think this way is fine too.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9341 +/- ##
==========================================
+ Coverage 74.24% 75.28% +1.03%
==========================================
Files 1332 1363 +31
Lines 40817 41805 +988
Branches 7634 7764 +130
==========================================
+ Hits 30306 31471 +1165
+ Misses 10511 10334 -177 ☔ View full report in Codecov by Sentry. |
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
Playwright test resultsDetails
Flaky testsmsedge-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user Skipped testschrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options |
What does this PR do?
For more information on our expectations for the PR process, see the
code review principles doc