Allow Custom Cache Provider in useSWR Options #4108
feifeilian
started this conversation in
RFC
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, when using custom caching with SWR, the custom cache provider can only be configured through the provider option within SWRConfig. This requires wrapping SWRConfig around every component that utilizes the custom provider, which can add mental overhead.
I propose adding the ability to specify the cache provider directly within the useSWR options. For example:
This would allow for more granular control over caching at the individual useSWR call level, reducing the need for multiple SWRConfig wrappers and simplifying component structure.
Would you consider implementing this feature?
Beta Was this translation helpful? Give feedback.
All reactions