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

forceRevalidate should have option or default to override debounce #346

Open
SanderCokart opened this issue Apr 20, 2023 · 2 comments
Open

Comments

@SanderCokart
Copy link

I am running in a situation where it would be extremely useful to use debouncing for initial gets but once mutate is called id like to override the debounce with forceRevalidate: true

Any thoughts?

@adamdehaven
Copy link
Member

Could you just point the settings to a ref and then update them accordingly as needed?

Otherwise, I'd need you to provide a simple reproduction code sandbox, etc.

@matthew-dean
Copy link

@SanderCokart You could declare one ref, use a debounced watcher function to set a "debounced" ref, and pass that into useSWRV. Then, when you want to update immediately, you could set the debounced ref directly, bypassing the debounce.

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

No branches or pull requests

3 participants