Removed MutationHandler type

This commit is contained in:
Luis Alvarez 2021-02-18 16:07:11 -05:00
parent 6dc7e0b632
commit a7df259bda
2 changed files with 1 additions and 24 deletions

View File

@ -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'

View File

@ -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