-
Notifications
You must be signed in to change notification settings - Fork 74
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
Clearing cache #281
Comments
This is something we also need mainly for unit testing. We need to be able to clear the cache |
Hey guys! Any plans to implement this? We've ran into the issue when
|
@mv-go would strongly consider keying off your user-id if sessions/cache calls are shared among browser sessions. You could achieve this by wrapping your useSwrv hook calls into a wrapper function that prefixes the user id keys, something like: #91 (comment). Would be cool to grab the cache to clear it like swr does: https://swr.vercel.app/docs/advanced/cache#access-to-the-cache |
I also need something like this. See: #352 |
A workaround I came up with: import Cache from 'swrv/dist/cache'
let cache = new Cache()
export default {
get() {
return cache
},
reset() {
cache = new Cache()
}
} Then set the cache option like: {
cache: FetchCache.get()
} |
Is there a way to clear all cached data? Say f.e. when a user signs out I feel more comfortable when all data gets cleared.
Any recommendations?
The text was updated successfully, but these errors were encountered: