Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): staleTime of Infinity always fresh. #98

Closed
wants to merge 2 commits into from

Conversation

nakagam3
Copy link
Contributor

@nakagam3 nakagam3 commented Nov 9, 2024

This PR modifies the staleTime option to accept Infinity as a valid value. If Infinity is specified, the cache will remain fresh indefinitely after the initial fetch, unless manually refetched.

This is useful in cases where the data doesn't update frequently, so refetching is unnecessary, and we may want to disable it for performance reasons.

I welcome your feedback on this change and am happy to make any necessary adjustments.

Copy link

netlify bot commented Nov 9, 2024

Deploy Preview for funny-banoffee-0afb46 canceled.

Name Link
🔨 Latest commit 13fa25b
🔍 Latest deploy log https://app.netlify.com/sites/funny-banoffee-0afb46/deploys/672f545fb190300008455c7b

@nakagam3 nakagam3 changed the title fix: staleTime of Infinity always fresh. feat(query): staleTime of Infinity always fresh. Nov 9, 2024
Copy link
Owner

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I pushed an alternative way to #99 because I couldn't push to your PR

@posva posva closed this in #99 Nov 9, 2024
@nakagam3
Copy link
Contributor Author

nakagam3 commented Nov 9, 2024

Thank you for your kindness! Your approach was really nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants