Download react-query/examples/react/nextjs-app-prefetching/app/pokemon.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 258 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/pokemon.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/pokemon.ts
-
curl -L -o pokemon.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/pokemon.ts
258 Bytes
| import { queryOptions } from '@tanstack/react-query' | |
| export const pokemonOptions = queryOptions({ | |
| queryKey: ['pokemon'], | |
| queryFn: async () => { | |
| const response = await fetch('https://pokeapi.co/api/v2/pokemon/25') | |
| return response.json() | |
| }, | |
| }) | |