mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
Adding axios.isCancel method
This commit is contained in:
@@ -230,7 +230,7 @@ const source: CancelTokenSource = axios.CancelToken.source();
|
||||
axios.get('/user', {
|
||||
cancelToken: source.token
|
||||
}).catch((thrown: AxiosError | Cancel) => {
|
||||
if (thrown instanceof axios.Cancel) {
|
||||
if (axios.isCancel(thrown)) {
|
||||
const cancel: Cancel = thrown;
|
||||
console.log(cancel.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user