commerce/framework/local/fetcher.ts
2021-06-22 17:12:31 -04:00

12 lines
225 B
TypeScript

import { Fetcher } from '@commerce/utils/types'
export const fetcher: Fetcher = async () => {
const res = await fetch('./data.json')
if (res.ok) {
const { data } = await res.json()
return data
}
throw res
}