Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /