portfolio/lib/fetcher.ts

7 lines
181 B
TypeScript

export default async function fetcher<JSON = any>(
input: RequestInfo,
init?: RequestInit
): Promise<JSON> {
const res = await fetch(input, init)
return res.json()
}