Replies: 1 comment
-
Try this: /mutation.js
So trackLiveQueries, tracks all APIs being fetched in a particular page when you use useSWR OR useSWRInfinite. So when you create/update/delete a post, it now revalidates all the APIs being tracked in that page. unstable_serialize is for useSWRInfinite, but it keeps long revalidating data. I'm yet to find a better solution for it. /app.js
/Component.js
|
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
So this is my setup
I have a client page where I fetch the data with useSWR like this
I use a custom fetcher where I configure my api url, request method, and data before sending the requets.
What I usually did was pass the bound mutate function down my components to where I need to call it (prop drilled it) to revalidate data and so on.
However I would like to call mutate remotely using the global muate function like I see in the docs.
Only issue is I have no idea how to do that. I am just not understanding the docs. They seem to just call the mutate function with a "key" which I assume is the...url? Not clear but tried it and it didnt work.
Any help is really appreciated...
Beta Was this translation helpful? Give feedback.
All reactions