add: added fetcher for swr

This commit is contained in:
Elie Baier 2023-12-05 23:51:41 +01:00
parent 0c207bea3c
commit 2a6480e2f1
1 changed files with 3 additions and 0 deletions

3
lib/fetcher.ts Normal file
View File

@ -0,0 +1,3 @@
import { stat } from "fs";
export const fetcher = (input: URL | RequestInfo, init?: RequestInit | undefined) => fetch(input, init).then(res => res.json().then(data => ({...data, status: res.status})));