How to use different arguments for fetcher and SWR cache? #1042
Answered
by
ErnestBrandi
willdavsmith
asked this question in
Q&A
-
Hi! I'm working on an application where it would be useful to have separate arguments for the fetcher and the SWR cache. const { data } = useSWR(
[url, accessToken], // I want this to be my cache key
(otherArg1, otherArg2) => fetcher(otherArg1, otherArg2) // I want these args to be sent to fetcher
) Currently otherArg1 and otherArg2 are being replaced by url and accessToken, as expected. Is there any way to accomplish my idea? |
Beta Was this translation helpful? Give feedback.
Answered by
ErnestBrandi
Mar 18, 2021
Replies: 1 comment
-
Hi, that
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
willdavsmith
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, that
fetcher
is just a function can't you do :