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

How can I set options after useSWRV is initialized

matthew-dean opened this issue · comments

Use case: I want to override options for useSWRV in tests, so that it doesn't cache responses between tests. Is there an API to set these globally such that it overrides individual useSWRV calls? Or some other easy-to-use approach for testing?

The easiest thing to do would be to utilize dependent fetching via a cache key and increment the key between tests.

Alternatively you could implement your own cache solution instead of relying on what is provided.