-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Fixing Cancel' signature. (#3152) #3153
Conversation
@@ -99,7 +99,7 @@ export interface CancelStatic { | |||
} | |||
|
|||
export interface Cancel { | |||
message: string; | |||
message: string | undefined; |
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.
message: string | undefined; | |
message?: string; |
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.
If I'm not wrong, the implementation looks different, the message
key is always present, but it could be undefined
. My proposal reflects that while yours means that message
could not exist. This CodeSandbox demonstrates it.
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 wrote this suggestion because I haven't found any undefined
word in the file (even for CancelStatic & Canceler) so I thought it would be consistent. But your words sound very logical to me (thanks for the detailed explanation btw) so its up to you.
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.
You're more than welcome! I suggested the change based on how Axios works instead of coding styles (that, considered alone, make completely sense 😉)
Co-authored-by: Jay <[email protected]>
Cancel'message could be undefined, this PR reflects that on the types.