Skip to content

Commit

Permalink
feat: Export isAxiosError and axios types
Browse files Browse the repository at this point in the history
So you do not need to install a possible different version of axios just for this.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Apr 29, 2024
1 parent 4bbe70c commit d7e0a6b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const client = Axios.create({
'X-Requested-With': 'XMLHttpRequest',
},
})

const cancelableClient: CancelableAxiosInstance = Object.assign(client, {
CancelToken: Axios.CancelToken,
isCancel: Axios.isCancel,
Expand All @@ -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'

0 comments on commit d7e0a6b

Please sign in to comment.