Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

pokemon.ts

10 lines258 Bytes

1import { queryOptions } from '@tanstack/react-query'
2​
3export const pokemonOptions = queryOptions({
4 queryKey: ['pokemon'],
5 queryFn: async () => {
6 const response = await fetch('https://pokeapi.co/api/v2/pokemon/25')
7​
8 return response.json()
9 },
10})