forked from crowetic/commerce
Removed MutationHandler type
This commit is contained in:
parent
6dc7e0b632
commit
a7df259bda
@ -6,12 +6,7 @@ import {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
import {
|
import { Fetcher, HookHandler, MutationHook } from './utils/types'
|
||||||
Fetcher,
|
|
||||||
HookHandler,
|
|
||||||
MutationHandler,
|
|
||||||
MutationHook,
|
|
||||||
} from './utils/types'
|
|
||||||
import type { FetchCartInput } from './cart/use-cart'
|
import type { FetchCartInput } from './cart/use-cart'
|
||||||
import type { Cart, Wishlist, Customer, SearchProductsData } from './types'
|
import type { Cart, Wishlist, Customer, SearchProductsData } from './types'
|
||||||
|
|
||||||
|
@ -74,24 +74,6 @@ export type HookHandler<
|
|||||||
fetcher?: HookFetcherFn<Data, FetchInput>
|
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<
|
export type HookFunction<
|
||||||
Input extends { [k: string]: unknown } | {},
|
Input extends { [k: string]: unknown } | {},
|
||||||
T
|
T
|
||||||
|
Loading…
x
Reference in New Issue
Block a user