Download react-query/integrations/angular-cli-20/src/app/app.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/angular-cli-20/src/app/app.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/angular-cli-20/src/app/app.ts
-
curl -L -o app.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/angular-cli-20/src/app/app.ts
570 Bytes
| import { Component } from '@angular/core' | |
| import { injectQuery } from '@tanstack/angular-query-experimental' | |
| ({ | |
| selector: 'app-root', | |
| template: ` | |
| @if (query.isPending()) { | |
| <div>Loading...</div> | |
| } | |
| @if (query.isError()) { | |
| <div>An error has occurred!</div> | |
| } | |
| @if (query.isSuccess()) { | |
| <div>{{ query.data() }}</div> | |
| } | |
| `, | |
| }) | |
| export class App { | |
| query = injectQuery(() => ({ | |
| queryKey: ['test'], | |
| queryFn: async () => { | |
| await new Promise((r) => setTimeout(r, 1000)) | |
| return 'Success' | |
| }, | |
| })) | |
| } | |