Kong / swrv

Stale-while-revalidate data fetching for Vue

Home Page:https://docs-swrv.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

forceRevalidate should have option or default to override debounce

SanderCokart opened this issue · comments

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?

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.

@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.