mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
Removed MutationHandler type
This commit is contained in:
parent
6dc7e0b632
commit
a7df259bda
@ -6,12 +6,7 @@ import {
|
||||
useMemo,
|
||||
useRef,
|
||||
} from 'react'
|
||||
import {
|
||||
Fetcher,
|
||||
HookHandler,
|
||||
MutationHandler,
|
||||
MutationHook,
|
||||
} from './utils/types'
|
||||
import { Fetcher, HookHandler, MutationHook } from './utils/types'
|
||||
import type { FetchCartInput } from './cart/use-cart'
|
||||
import type { Cart, Wishlist, Customer, SearchProductsData } from './types'
|
||||
|
||||
|
@ -74,24 +74,6 @@ export type HookHandler<
|
||||
fetcher?: HookFetcherFn<Data, FetchInput>
|
||||
}
|
||||
|
||||
export type MutationHandler<
|
||||
// Data obj returned by the hook and fetch operation
|
||||
Data,
|
||||
// Input expected by the hook
|
||||
Input extends { [k: string]: unknown } = {},
|
||||
// Input expected before doing a fetch operation
|
||||
FetchInput extends { [k: string]: unknown } = {}
|
||||
> = {
|
||||
useHook?(context: {
|
||||
input: Input
|
||||
}): (context: {
|
||||
input: FetchInput
|
||||
fetch: (context: { input: FetchInput }) => Data | Promise<Data>
|
||||
}) => Data | Promise<Data>
|
||||
fetchOptions: HookFetcherOptions
|
||||
fetcher?: HookFetcherFn<Data, FetchInput>
|
||||
}
|
||||
|
||||
export type HookFunction<
|
||||
Input extends { [k: string]: unknown } | {},
|
||||
T
|
||||
|
Loading…
x
Reference in New Issue
Block a user