MCPcopy Create free account
hub / github.com/TanStack/query / addTodo

Method addTodo

examples/lit/basic/src/main.ts:105–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103 }
104
105 private addTodo(): void {
106 const title = this.nextTodoTitle.trim()
107 if (!title) {
108 return
109 }
110
111 this.createTodoMutation.mutate(title)
112 this.nextTodoTitle = ''
113 }
114
115 private async invalidateTodos(): Promise<void> {
116 await demoQueryClient.invalidateQueries({ queryKey: ['todos'] })

Callers 2

renderMethod · 0.95
renderMethod · 0.80

Calls 1

mutateMethod · 0.45

Tested by

no test coverage detected