Replies: 2 comments 1 reply
-
I think in that case, I wouldn’t directly edit the cache, because it won’t sync that state with all hooks. Maybe we should expose |
Beta Was this translation helpful? Give feedback.
-
Hello, I have a similar need to access the cache in |
Beta Was this translation helpful? Give feedback.
-
I'd like to access the cache from an
onError
handler so that I can invalidate previously cached values in response to certain types of errors.I see that
onError
takes theconfig
object as its third parameter, and in practice, theconfig
object appears to contain acache
member. However, it doesn't appear to be permitted by the TypeScript types or documented.Is it permitted to access this member? Can/should the types be updated to reflect this? Or can/should SWR add an alternative standardized way of accessing the cache for the current request?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions