In production, mutations aren't going to happen instantly. We can improve the UX by rendering the intended result before the actual mutation happens
In this lesson, we will learn how to handle optimistic updates by simulating an internet connection with a setTimeout
and using optimisticResponse
from the useMutation
composable to handle the update.