Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 0e52034

Browse files
authored
Merge pull request #243 from rliang/patch-1
Allow setting revalidate to 0
2 parents 3014f4f + a2784d8 commit 0e52034

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/react/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function useDeno<T = any>(callback: () => (T | Promise<T>), revalidate?:
4040
const dataUrl = 'pagedata://' + pathname
4141
const eventName = 'useDeno-' + dataUrl
4242
const key = dataUrl + '#' + id
43-
const expires = revalidate ? Date.now() + revalidate * 1000 : 0
43+
const expires = typeof revalidate === 'number' && !isNaN(revalidate) ? Date.now() + revalidate * 1000 : 0
4444
const renderingDataCache = global['rendering-' + dataUrl]
4545
if (renderingDataCache && key in renderingDataCache) {
4646
return renderingDataCache[key] // 2+ pass

0 commit comments

Comments
 (0)