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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Expand Up @@ -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 😉)

}

export interface Canceler {
Expand Down