Like reducer logic, optimistic update functions should avoid mutation and return the next optimistic state immutably.