Skip to content

Commit 70e982b

Browse files
author
Alex Cory
committed
Merge branch 'master' of github.com:alex-cory/react-usefetch
2 parents 282fe5a + 0832cdd commit 70e982b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useFetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function useFetch<TData = any>(...args: UseFetchArgs): UseFetch<TData> {
131131
return theData
132132
}
133133

134-
if (cachePolicy === CACHE_FIRST) {
134+
if (cachePolicy === CACHE_FIRST && !response.isCached) {
135135
await cache.set(response.id, newRes.clone())
136136
}
137137

0 commit comments

Comments
 (0)