@@ -2,9 +2,6 @@ import { computed, Ref, ref } from "@vue/composition-api";
22import  axios ,  {  AxiosRequestConfig ,  AxiosResponse ,  AxiosInstance ,  CancelTokenSource  }  from  "axios" ; 
33import  {  usePromise ,  PromiseResultFactory ,  isString ,  isBoolean ,  isObject  }  from  "@vue-composable/core" ; 
44
5- /* istanbul ignore next */ 
6- const  _axios  =  axios  ||  ( globalThis  &&  ( globalThis  as  any ) . axios ) ; 
7- 
85interface  AxiosReturn < TData >  extends  PromiseResultFactory < Promise < AxiosResponse < TData > > ,  [ AxiosRequestConfig ] >  { 
96 readonly  client : Ref < Readonly < AxiosInstance > > ; 
107 readonly  data : Ref < TData  |  null > ; 
@@ -30,13 +27,13 @@ export function useAxios<TData = any>(config?: AxiosRequestConfig, throwExceptio
3027export  function  useAxios < TData  =  any > ( configUrlThrowException ?: AxiosRequestConfig  |  string  |  boolean ,  configThrowException ?: AxiosRequestConfig  |  boolean ,  throwException  =  false ) : AxiosReturn < TData >  { 
3128 /* istanbul ignore next */ 
3229 __DEV__  && 
33-  ! _axios  && 
30+  ! axios  && 
3431 console . warn ( `[axios] not installed, please install it` ) ; 
3532
3633 const  config  =  ! isString ( configUrlThrowException )  &&  ! isBoolean ( configUrlThrowException )  ? configUrlThrowException  : isObject ( configThrowException )  ? configThrowException  as  AxiosRequestConfig  : undefined ; 
3734 throwException  =  isBoolean ( configUrlThrowException )  ? configUrlThrowException  : isBoolean ( configThrowException )  ? configThrowException  : throwException ; 
3835
39-  const  axiosClient  =  _axios . create ( config ) ; 
36+  const  axiosClient  =  axios . create ( config ) ; 
4037 const  client  =  computed ( ( )  =>  axiosClient ) ; 
4138 const  isCancelled  =  ref ( false ) ; 
4239 const  cancelledMessage  =  ref < string > ( null ) ; 
@@ -55,7 +52,7 @@ export function useAxios<TData = any>(configUrlThrowException?: AxiosRequestConf
5552 } 
5653
5754 const  use  =  usePromise ( async  ( request : AxiosRequestConfig )  =>  { 
58-  cancelToken  =  _axios . CancelToken . source ( ) 
55+  cancelToken  =  axios . CancelToken . source ( ) 
5956 isCancelled . value  =  false ; 
6057 cancelledMessage . value  =  null ; 
6158
0 commit comments