Skip to content

Implementing optimistic updates with SWR #727

Answered by frankdilo
frankdilo asked this question in Ideas
Discussion options

You must be logged in to vote

It helped, thanks. For anyone stumbling into this, the solution is to do use one of the parameters of mutate, the last one, which defines wether to revalidate or not. mutate(key, value, false), changes the value in the cache, without triggering a revalidation with the server, so avoiding all problems I outlined above.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shuding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants