How to simply delete query entry? #315
Unanswered
Perdolique
asked this question in
Questions
Replies: 1 comment 9 replies
-
You have to use const cache = useQueryCache()
// if you know it exists
cache.remove(cache.get(['my', 'key'])!)
// delete multiple entries at once
cache.getEntries({ key: ['my-root-key'] }).map(entry => cache.remove(entry)) BTW it's better to adapt the |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey. I'm removing things on the page, and I want to simply remove a cache entry by a specific key.
At the moment, it's possible by getting all entries by key using
cache.getEntries()
and then removing each entry one by one using thecache.remove()
method. Is there a simple built-in method that allows you to just remove entries by key without refetching? Something likecache.removeEntries({ key: [...] })
Beta Was this translation helpful? Give feedback.
All reactions