Skip to content

Commit 2815b1c

Browse files
docs: fix typo in Rollback examples (#335)
* docs: fix typo in Rollback examples * docs: add comma Co-Authored-By: Kamran Ayub <[email protected]> * docs: add comma after rollback() Co-authored-by: Kamran Ayub <[email protected]>
1 parent f53d31a commit 2815b1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ useMutation(updateTodo, {
14011401
return () => queryCache.setQueryData('todos', previousTodos)
14021402
},
14031403
// If the mutation fails, use the value returned from onMutate to roll back
1404-
onError: (err, newTodo, rollback) => rollback
1404+
onError: (err, newTodo, rollback) => rollback(),
14051405
// Always refetch after error or success:
14061406
onSettled: () => {
14071407
queryCache.refetchQueries('todos')
@@ -1425,7 +1425,7 @@ useMutation(updateTodo, {
14251425
return () => queryCache.setQueryData(['todos', newTodo.id], previousTodo)
14261426
},
14271427
// If the mutation fails, use the rollback function we returned above
1428-
onError: (err, newTodo, rollback) => rollback()
1428+
onError: (err, newTodo, rollback) => rollback(),
14291429
// Always refetch after error or success:
14301430
onSettled: () => {
14311431
queryCache.refetchQueries(['todos', newTodo.id])

0 commit comments

Comments
 (0)