MCPcopy Create free account
hub / github.com/TanStack/db / update

Function update

examples/react/offline-transactions/src/utils/todos.ts:52–65  ·  view source on GitHub ↗
(id: string, updates: TodoUpdate)

Source from the content-addressed store, hash-verified

50 },
51
52 update(id: string, updates: TodoUpdate): Todo | null {
53 const existing = todosStore.get(id)
54 if (!existing) {
55 return null
56 }
57
58 const updated: Todo = {
59 ...existing,
60 ...updates,
61 updatedAt: new Date(),
62 }
63 todosStore.set(id, updated)
64 return updated
65 },
66
67 delete(id: string): boolean {
68 return todosStore.delete(id)

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected