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

Fixing Cancel' signature. (#3152) #3153

Merged
merged 3 commits into from Dec 22, 2021
Merged

Fixing Cancel' signature. (#3152) #3153

merged 3 commits into from Dec 22, 2021

Conversation

NoriSte
Copy link
Contributor

@NoriSte NoriSte commented Jul 27, 2020

Cancel'message could be undefined, this PR reflects that on the types.

@@ -99,7 +99,7 @@ export interface CancelStatic {
}

export interface Cancel {
message: string;
message: string | undefined;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message: string | undefined;
message?: string;

Copy link
Contributor Author

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.

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.

Copy link
Contributor Author

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 😉)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants