# Angular Best Practices Tanstack

> TanStack Query best practices for Angular. Covers query/mutation patterns, cache invalidation, and query key factories for server state management. Activates when working with @tanstack/angular-query-experimental. Do not use for NgRx Effects, manual HTTP caching, or RxJS-based server state. Install alongside angular-best-practices for full coverage.

- Skill: `alfredoperez/angular-best-practices-tanstack` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add alfredoperez/angular-best-practices-tanstack`
- Raw SKILL.md: https://api.skillmd.com/api/skills/alfredoperez/angular-best-practices-tanstack/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: alfredoperez (https://skillmd.com/u/alfredoperez)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/alfredoperez/angular-best-practices-tanstack

---


# Angular TanStack Query Best Practices

TanStack Query rules for server state with automatic caching, deduplication, and background refetching. Use with the core
[angular-best-practices](https://skills.sh/alfredoperez/angular-best-practices/angular-best-practices)
skill for comprehensive Angular coverage.

## Links

- [Core Skill: angular-best-practices](https://skills.sh/alfredoperez/angular-best-practices/angular-best-practices)
- [Browse All Skills](https://skills.sh/alfredoperez/angular-best-practices)
- [GitHub Repository](https://github.com/alfredoperez/angular-best-practices)

## When to Apply

- Fetching data from APIs with `injectQuery`
- Performing mutations with cache invalidation
- Structuring query keys for hierarchical invalidation

## Rules

| Rule | Impact | Description |
|------|--------|-------------|
| Know When to Use TanStack Query | MEDIUM | Server state (APIs) vs client state (signals) |
| Use Query Key Factories | MEDIUM | Consistent key structure for hierarchical invalidation |

## Install

Install from [skills.sh/alfredoperez/angular-best-practices](https://skills.sh/alfredoperez/angular-best-practices):

- Core skill: [angular-best-practices](https://skills.sh/alfredoperez/angular-best-practices/angular-best-practices)
- This add-on: [angular-best-practices-tanstack](https://skills.sh/alfredoperez/angular-best-practices/angular-best-practices-tanstack)

