Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Mar 8, 2023
1 parent 58dd975 commit 97e8e28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ export function defineCachedFunction<T = any>(
const _resolve = async () => {
const isPending = pending[key];
if (!isPending) {
if (entry.value !== undefined && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) {
if (
entry.value !== undefined &&
(opts.staleMaxAge || 0) >= 0 &&
opts.swr === false
) {
// Remove cached entry to prevent using expired cache on concurrent requests
entry.value = undefined;
entry.integrity = undefined;
Expand Down

0 comments on commit 97e8e28

Please sign in to comment.