portfolio/lib/fetcher.ts

7 lines
181 B
TypeScript
Raw Normal View History

2023-02-22 22:17:24 +00:00
export default async function fetcher<JSON = any>(
input: RequestInfo,
init?: RequestInit
): Promise<JSON> {
const res = await fetch(input, init)
return res.json()
}