Some questions about mutate
function API
#2836
Unanswered
ansavchenco
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I having trouble wrapping my head around the SWR mutate function API. I find existing documentation really confusing. Here are the things that i have trouble understanding.
data
isand
optimisticData
isDoes
data
update the client cache not immediately? If so, then when does it do that?optimisticData
option also seems redundant as optimistic update can we achieved with updateddata
provided as a second param (taken into account thatpopulateCache
istrue
by default).populateCache
option at all? Again, docs say that when it's set totrue
thenbut i already provided updated data to
data
param which should update the cache (the docs say that) i.e. populate it i suppose?populateCache
tofalse
? Isn't it gonna be the same as just doingmutate(key)
to trigger a revalidation and a later cache update?Beta Was this translation helpful? Give feedback.
All reactions