-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
#2808 Preloaded state is now selectively partial (instead of deeply partial). #3485
#2808 Preloaded state is now selectively partial (instead of deeply partial). #3485
Conversation
Deploy preview for redux-docs ready! Built with commit fba87fe |
Found a better way to type check CombinedState which allows the $CombinedState symbol property marker to be optional. Since it's optional, it's no longer necessary to strip it off in the Reducer state parameter type and return type. This leaves the type definition for Reducer unmodified, reduces the number of types required by one, and makes the resolved types and stack traces clearer.
It looks like we can get rid of |
Leaving the definition in place as removing it would be a breaking change.
Unsure why prettier doesn't like |
Ah, this branch was behind master, which had prettier formatting flaws in the UsingObjectSpreadOperator.md. Fixed the formatting and re-pushed. |
@ChrisAckerman Do you want to resolve the conflicts here? |
@timdorr Done. |
Awesome, thanks! |
…eeply partial). (reduxjs#3485) * Preloaded state is now selectively partial (instead of deeply partial). * Improved CombinedState, PreloadedState, and removed UnCombinedState. Found a better way to type check CombinedState which allows the $CombinedState symbol property marker to be optional. Since it's optional, it's no longer necessary to strip it off in the Reducer state parameter type and return type. This leaves the type definition for Reducer unmodified, reduces the number of types required by one, and makes the resolved types and stack traces clearer. * Small change to the description of CombinedState. * Removed DeepPartial import from tests. Leaving the definition in place as removing it would be a breaking change. * Made prettier happy. * Made prettier happy with UsingObjectSpreadOperator.md Former-commit-id: 41c0612 Former-commit-id: b41174f
…eeply partial). (reduxjs#3485) * Preloaded state is now selectively partial (instead of deeply partial). * Improved CombinedState, PreloadedState, and removed UnCombinedState. Found a better way to type check CombinedState which allows the $CombinedState symbol property marker to be optional. Since it's optional, it's no longer necessary to strip it off in the Reducer state parameter type and return type. This leaves the type definition for Reducer unmodified, reduces the number of types required by one, and makes the resolved types and stack traces clearer. * Small change to the description of CombinedState. * Removed DeepPartial import from tests. Leaving the definition in place as removing it would be a breaking change. * Made prettier happy. * Made prettier happy with UsingObjectSpreadOperator.md Former-commit-id: 41c0612 Former-commit-id: b41174f
Fixes #2808 by using a specialized (but effectively NO-OP) type
CombinedState
to indicate that theReducer
returned bycombineReducers()
has a generic state type which should be considered shallowly partial.NOTE: Requires Typescript >= 3.5 to work correctly.