Skip to content

Conversation

@NoriSte
Copy link
Contributor

@NoriSte NoriSte commented Jul 27, 2020

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


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.

4 participants