Skip to content

Commit

Permalink
fix(useAxios): rename aborted to isAborted (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaubree committed Apr 23, 2022
1 parent af3e877 commit e2a9ac3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/integrations/useAxios/index.ts
Expand Up @@ -25,11 +25,11 @@ export interface UseAxiosReturn<T> {
* Indicates if the request is currently loading
*/
isLoading: Ref<boolean>

/**
* Indicates if the request was canceled
*/
aborted: Ref<boolean>
isAborted: Ref<boolean>

/**
* Any errors that may have occurred
Expand All @@ -47,9 +47,14 @@ export interface UseAxiosReturn<T> {
finished: Ref<boolean>

/**
* loading alias
* isLoading alias
*/
loading: Ref<boolean>

/**
* isAborted alias
*/
aborted: Ref<boolean>

/**
* abort alias
Expand Down Expand Up @@ -126,7 +131,7 @@ export function useAxios<T = any>(...args: any[]): OverallUseAxiosReturn<T> & Pr
const data = shallowRef<T>()
const isFinished = ref(false)
const isLoading = ref(false)
const aborted = ref(false)
const isAborted = ref(false)
const error = shallowRef<AxiosError<T>>()

const cancelToken: CancelTokenSource = axios.CancelToken.source()
Expand All @@ -135,7 +140,7 @@ export function useAxios<T = any>(...args: any[]): OverallUseAxiosReturn<T> & Pr
return

cancelToken.cancel(message)
aborted.value = true
isAborted.value = true
isLoading.value = false
isFinished.value = false
}
Expand Down Expand Up @@ -178,8 +183,9 @@ export function useAxios<T = any>(...args: any[]): OverallUseAxiosReturn<T> & Pr
isFinished,
isLoading,
cancel: abort,
canceled: aborted,
aborted,
isAborted,
canceled: isAborted,
aborted: isAborted,
abort,
execute,
} as OverallUseAxiosReturn<T>
Expand Down

0 comments on commit e2a9ac3

Please sign in to comment.