Fixing Cancel' signature. (#3152)#3153
Fixing Cancel' signature. (#3152)#3153jasonsaayman merged 3 commits intoaxios:masterfrom NoriSte:master
Conversation
|
|
||
| export interface Cancel { | ||
| message: string; | ||
| message: string | undefined; |
There was a problem hiding this comment.
| message: string | undefined; | |
| message?: string; |
There was a problem hiding this comment.
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.
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.
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 <jasonsaayman@gmail.com>
Cancel'message could be undefined, this PR reflects that on the types.