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

How can I set options after useSWRV is initialized #352

Open
matthew-dean opened this issue Jul 2, 2023 · 1 comment
Open

How can I set options after useSWRV is initialized #352

matthew-dean opened this issue Jul 2, 2023 · 1 comment

Comments

@matthew-dean
Copy link

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?

@adamdehaven
Copy link
Member

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.

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

2 participants