Open
Description
We've got utils to add and update cache entries, but we don't have one that would remove a specific cache entry by key.
We've had a couple requests for something like this recently, so worth discussing.
Lenz had these thoughts in chat:
Two different use cases though:
- delete on invalidate with refetch
- manually delete
For the first, we could add something like
invalidationBehaviour: 'refetch' | 'remove-and-refetch'
- both globally and on endpoints.And the second... yeah, I guess we could add that as well, but the user story there is not exactly clear yet tbh.
Either way: the hooks would still hold on to the value, but of course
currentData
would be available
What specific use cases do people have for wanting to manually remove a cache entry?