Skip to content

Commit

Permalink
feat(return) unset isLoading in cases not covered by tests (Kong#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivos committed Sep 25, 2022
1 parent 5276321 commit ac9a3d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/use-swrv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function useSWRV<Data = any, Error = any> (...args): IResponse<Data, Error> {
(opts?.forceRevalidate !== undefined && !opts?.forceRevalidate)
) {
stateRef.isValidating = false
// stateRef.isLoading = false
stateRef.isLoading = false
return
}

Expand All @@ -268,7 +268,7 @@ function useSWRV<Data = any, Error = any> (...args): IResponse<Data, Error> {

if (!shouldRevalidate) {
stateRef.isValidating = false
// stateRef.isLoading = false
stateRef.isLoading = false
return
}
}
Expand All @@ -284,7 +284,7 @@ function useSWRV<Data = any, Error = any> (...args): IResponse<Data, Error> {
await mutate(keyVal, promiseFromCache.data, config.cache, ttl)
}
stateRef.isValidating = false
// stateRef.isLoading = false
stateRef.isLoading = false
PROMISES_CACHE.delete(keyVal)
if (stateRef.error !== undefined) {
const shouldRetryOnError = config.shouldRetryOnError && (opts ? opts.shouldRetryOnError : true)
Expand Down

0 comments on commit ac9a3d3

Please sign in to comment.