Skip to content

Commit

Permalink
docs(angular-query): remove outdated comment from example
Browse files Browse the repository at this point in the history
* Update invalidations-from-mutations.md

* Update invalidations-from-mutations.md

* restore first code snippet

---------

Co-authored-by: Arnoud de Vries <[email protected]>
  • Loading branch information
ayush-seth and arnoud-dv authored Jan 3, 2025
1 parent b25a41e commit 6184a89
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions docs/framework/angular/guides/invalidations-from-mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ replace: { 'useMutation': 'injectMutation', 'hook': 'function' }
[//]: # 'Example'

```ts
class TodoItemComponent {
mutation = injectMutation(() => ({
mutationFn: postTodo,
}))
}
mutation = injectMutation(() => ({
mutationFn: postTodo,
}))
```

[//]: # 'Example'
Expand All @@ -33,9 +31,6 @@ export class TodosComponent {
onSuccess: () => {
this.queryClient.invalidateQueries({ queryKey: ['todos'] })
this.queryClient.invalidateQueries({ queryKey: ['reminders'] })

// OR use the queryClient that is injected into the component
// this.queryClient.invalidateQueries({ queryKey: ['todos'] })
},
}))
}
Expand Down

0 comments on commit 6184a89

Please sign in to comment.