This commit is contained in:
Luis Alvarez 2021-01-19 18:45:50 -05:00
parent 10318b2fab
commit a7baff45fc

View File

@ -59,12 +59,14 @@ const useData: UseData = (options, input, fetcherFn, swrOptions) => {
swrOptions
)
defineProperty(response, 'isLoading', {
get() {
return response.data === undefined
},
set: (x) => x,
})
if (!('isLoading' in response)) {
defineProperty(response, 'isLoading', {
get() {
return response.data === undefined
},
set: (x) => x,
})
}
return response
}