From d7e0a6b3d389ebb9612dd3dcd0055ddfe4e82cae Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 29 Apr 2024 23:17:03 +0200 Subject: [PATCH] feat: Export `isAxiosError` and axios types So you do not need to install a possible different version of axios just for this. Signed-off-by: Ferdinand Thiessen --- lib/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/index.ts b/lib/index.ts index 3ef50b9..d82be94 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -16,6 +16,7 @@ const client = Axios.create({ 'X-Requested-With': 'XMLHttpRequest', }, }) + const cancelableClient: CancelableAxiosInstance = Object.assign(client, { CancelToken: Axios.CancelToken, isCancel: Axios.isCancel, @@ -28,3 +29,7 @@ cancelableClient.interceptors.response.use(r => r, onNotLoggedInError) onRequestTokenUpdate(token => { client.defaults.headers.requesttoken = token }) export default cancelableClient + +export { isAxiosError, isCancel } from 'axios' + +export type * from 'axios'