mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 21:51:21 +00:00
23 lines
525 B
TypeScript
23 lines
525 B
TypeScript
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
|
import { Customer } from '@commerce/types'
|
|
import { SWRHook } from '@commerce/utils/types'
|
|
|
|
export default useCustomer as UseCustomer<typeof handler>
|
|
|
|
export const handler: SWRHook<Customer | null> = {
|
|
fetchOptions: {
|
|
query: ``,
|
|
},
|
|
async fetcher() {
|
|
return null
|
|
},
|
|
useHook: ({ useData }) => (input) => {
|
|
return useData({
|
|
swrOptions: {
|
|
revalidateOnFocus: false,
|
|
...input?.swrOptions,
|
|
},
|
|
})
|
|
},
|
|
}
|