-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
refactor: Upgrade Redux #11967
refactor: Upgrade Redux #11967
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11967 +/- ##
==========================================
+ Coverage 63.75% 63.81% +0.05%
==========================================
Files 941 941
Lines 45654 45860 +206
Branches 4389 4459 +70
==========================================
+ Hits 29106 29264 +158
- Misses 16371 16418 +47
- Partials 177 178 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -86,7 +86,7 @@ export function fetchFaveStar(sliceId: string) { | |||
|
|||
export const SAVE_FAVE_STAR = 'SAVE_FAVE_STAR'; | |||
export function saveFaveStar(sliceId: string, isStarred: boolean) { | |||
return function (dispatch: Dispatch<ReturnType<typeof addDangerToast>>) { |
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.
The latest version of Redux has a better-typed dispatch
function, so the extra typing here doesn't compile anymore, for good reason.
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.
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.
This is a good move!
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.
LGTM. Thanks for making this!
SUMMARY
At @graceguo-supercat's suggestion, I've extracted the Redux upgrade done by @pkdotson and myself in #11814. This gets us ✨ hooks ✨ for redux state!
Many tests had to be changed because Enzyme can't propagate context correctly through shallow-rendered components. Side note: can't wait to start using react-testing-library.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION