Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ useMutation(updateTodo, {
return () => queryCache.setQueryData('todos', previousTodos)
},
// If the mutation fails, use the value returned from onMutate to roll back
onError: (err, newTodo, rollback) => rollback
onError: (err, newTodo, rollback) => rollback(),
// Always refetch after error or success:
onSettled: () => {
queryCache.refetchQueries('todos')
Expand All @@ -1425,7 +1425,7 @@ useMutation(updateTodo, {
return () => queryCache.setQueryData(['todos', newTodo.id], previousTodo)
},
// If the mutation fails, use the rollback function we returned above
onError: (err, newTodo, rollback) => rollback()
onError: (err, newTodo, rollback) => rollback(),
// Always refetch after error or success:
onSettled: () => {
queryCache.refetchQueries(['todos', newTodo.id])
Expand Down