mirror of
https://github.com/vercel/commerce.git
synced 2025-03-31 01:05:53 +00:00
13 lines
262 B
TypeScript
13 lines
262 B
TypeScript
import { HookFetcherFn } from './types'
|
|
|
|
const defaultFetcher: HookFetcherFn<any> = async ({
|
|
options,
|
|
fetch,
|
|
normalize,
|
|
}) => {
|
|
const data = await fetch({ ...options })
|
|
return data && normalize ? normalize(data) : data
|
|
}
|
|
|
|
export default defaultFetcher
|