mirror of
https://github.com/TanStack/query.git
synced 2026-11-16 22:50:20 +00:00
* chore(*): adopt '@tanstack/oxlint-config' and '@tanstack/oxfmt-config', and fix the newly reported lint errors * chore(pnpm-lock.yaml): run 'pnpm dedupe' * chore(scripts): move 'oxlint/plugin.ts' to 'oxlint-plugin.ts' to match the flat layout of 'scripts' * chore(pnpm-workspace.yaml): update '@typescript-eslint/parser' and '@typescript-eslint/rule-tester' to '^8.72.1' to match the deduped '@typescript-eslint/utils' |
History
|
|
|---|---|---|
| .. | ||
| .devcontainer | ||
| public | ||
| src | ||
| .gitignore | ||
| angular.json | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
TanStack Angular Query Simple Example
Fetches a single GitHub repository and shows its stats.
How it works
src/app/components/simple-example.component.tscallsinjectQuerywithqueryKey: ['repoData']and aqueryFnthat fetches theTanStack/queryrepository withHttpClientand converts it withlastValueFrom.src/app/components/simple-example.component.htmlrenders from the query's signals:isPending(),isError()witherror(), anddata()for the repository's name, description and counts.src/app/app.config.tsregisters aQueryClientwithprovideTanStackQueryandwithDevtools(), and providesHttpClientwithprovideHttpClient(withFetch()).
To run this example:
npm installnpm start