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

Make action helpers use the dispatch(actionCreator()) pattern #9341

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

grahamlangford
Copy link
Collaborator

What does this PR do?

  • Refactors our action helpers that take dispatch as an arg and refactored to be higher order functions

For more information on our expectations for the PR process, see the
code review principles doc

@@ -95,7 +95,7 @@ export type DeploymentsState = {
};

function useDeployments(): DeploymentsState {
const dispatch = useDispatch<Dispatch>();
const dispatch = useDispatch<AsyncDispatch>();
Copy link
Collaborator Author

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

Copy link
Collaborator

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.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 82.14286% with 10 lines in your changes missing coverage. Please review.

Project coverage is 75.28%. Comparing base (8318d74) to head (7664f44).
Report is 408 commits behind head on main.

Files with missing lines Patch % Lines
src/store/deactivateModHelpers.ts 0.00% 6 Missing ⚠️
...onConsole/pages/deployments/activateDeployments.ts 92.00% 2 Missing ⚠️
src/pageEditor/hooks/useCreateModFromUnsavedMod.ts 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link

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.

Copy link

github-actions bot commented Oct 23, 2024

Playwright test results

passed  141 passed
flaky  1 flaky
skipped  2 skipped

Details

report  Open report ↗︎
stats  144 tests across 47 suites
duration  10 minutes, 44 seconds
commit  7664f44
info  For more information on how to debug and view this report, see our readme

Flaky tests

msedge-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user

Skipped tests

chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

@grahamlangford grahamlangford merged commit 395686e into main Oct 24, 2024
20 checks passed
@grahamlangford grahamlangford deleted the dispatch-improvements branch October 24, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants