(id: string, changes: Partial<Todo>)
| 2611 | .mockImplementation(() => Promise.resolve([...serverTodos])) |
| 2612 | |
| 2613 | async function updateTodo(id: string, changes: Partial<Todo>) { |
| 2614 | await new Promise((resolve) => setTimeout(resolve, 10)) |
| 2615 | const todo = serverTodos.find((t) => t.id === id) |
| 2616 | if (todo) { |
| 2617 | Object.assign(todo, changes) |
| 2618 | } |
| 2619 | return todo |
| 2620 | } |
| 2621 | |
| 2622 | const todosCollection = createCollection( |
| 2623 | queryCollectionOptions<Todo>({ |