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

api.ts

9 lines290 Bytes

1import type { Repo } from './types'
2​
3export const reposAPI = {
4 getRepo: async (): Promise<Repo> => {
5 const response = await fetch('https://api.github.com/repos/TanStack/query')
6 if (!response.ok) throw new Error('Failed to fetch repo data')
7 return await response.json()
8 },
9}