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

Method addTodo

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

Source from the content-addressed store, hash-verified

94 }
95
96 private addTodo(): void {
97 const title = this.nextTodoTitle.trim()
98 if (!title) {
99 return
100 }
101
102 this.createTodoMutation.mutate(title)
103 this.nextTodoTitle = ''
104 }
105
106 private async invalidateTodos(): Promise<void> {
107 await demoQueryClient.invalidateQueries({ queryKey: todosQueries.all() })

Callers 2

renderMethod · 0.95
renderMethod · 0.80

Calls 1

mutateMethod · 0.45

Tested by

no test coverage detected