expose isValidating
This commit is contained in:
1 parent
fcfad945a0
commit
7a66b5310b
1 file changed
+2
-1
@@ -21,7 +21,7 @@ export const useGet = <T>(
|
|||||||
axiosConfig?: AxiosRequestConfig,
|
axiosConfig?: AxiosRequestConfig,
|
||||||
swrConfig?: SWRConfiguration
|
swrConfig?: SWRConfiguration
|
||||||
) => {
|
) => {
|
||||||
const { data, error, isLoading, mutate } = useSWR<ApiResponse<T>>(
|
const { data, error, isLoading, isValidating, mutate } = useSWR<ApiResponse<T>>(
|
||||||
url,
|
url,
|
||||||
(url: string) => fetcher<T>(url, axiosConfig),
|
(url: string) => fetcher<T>(url, axiosConfig),
|
||||||
swrConfig
|
swrConfig
|
||||||
@@ -30,6 +30,7 @@ export const useGet = <T>(
|
|||||||
return {
|
return {
|
||||||
data: data?.data ?? null,
|
data: data?.data ?? null,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
isValidating,
|
||||||
error,
|
error,
|
||||||
refetch: mutate,
|
refetch: mutate,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user