Implement Shopify Provider

This commit is contained in:
cond0r
2021-02-04 13:23:44 +02:00
parent c06d9dae3a
commit 14c3f961b3
61 changed files with 16405 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
import type { HookFetcher } from '@commerce/utils/types'
import type { SwrOptions } from '@commerce/utils/use-data'
import useCommerceCustomer from '@commerce/use-customer'
const defaultOpts = {}
export type Customer = {
entityId: number
firstName: string
lastName: string
email: string
}
export type CustomerData = {}
export const fetcher: HookFetcher<Customer | null> = async () => {
return null
}
export function extendHook(
customFetcher: typeof fetcher,
swrOptions?: SwrOptions<Customer | null>
) {
const useCustomer = () => {
return { data: { firstName: null, lastName: null, email: null } }
}
useCustomer.extend = extendHook
return useCustomer
}
export default extendHook(fetcher)