-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Suggestion: Difference Types #15059
Comments
Duplicate of #4183 |
This is almost exactly my use case here as well: #14626 Good to see others wanting this too. Not sure how challenging it would be to implement. |
Yeah, this comes up a lot in the React ecosystem a lot due to the proliferation of HOCs in general (I hit it in react-router). I've upvoted all the relevant issues, including #12215 which seems to be most likely to happen. For instance, in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/fe1b612ef0d9ffd45114431adac61b5e6ee1173f/types/react-router/index.d.ts#L101, the return should be |
Great to see this is consolidating and moving along! |
The C# app now runs npm to run the start.js script which starts the webserver. Also started some work on recieving the initial state and saving that state off. Updated some modules which caused a typing issue in connect(). Had to move some interface definitions around to get it working. Ideally it would be fixed with microsoft/TypeScript#15059
The Problem
Let's say that we're building a redux-style connect method. In order to have well-enforced typing on the resulting component it would be useful to have the idea of a difference type.
The way we could type the connect method would be as follows (sorry, it's long):
Proposed Solution
The proposal is to add difference types. This would be where the keys of one interface could be subtracted from the keys of another interface.
The theoretical syntax would be to use a
-
to specify this.The text was updated successfully, but these errors were encountered: