mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
Added framework folder
This commit is contained in:
17
framework/commerce/wishlist/use-wishlist.tsx
Normal file
17
framework/commerce/wishlist/use-wishlist.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { responseInterface } from 'swr'
|
||||
import type { HookInput, HookFetcher, HookFetcherOptions } from '../utils/types'
|
||||
import useData, { SwrOptions } from '../utils/use-data'
|
||||
|
||||
export type WishlistResponse<Result> = responseInterface<Result, Error> & {
|
||||
isEmpty: boolean
|
||||
}
|
||||
|
||||
export default function useWishlist<Result, Input = null>(
|
||||
options: HookFetcherOptions,
|
||||
input: HookInput,
|
||||
fetcherFn: HookFetcher<Result, Input>,
|
||||
swrOptions?: SwrOptions<Result, Input>
|
||||
) {
|
||||
const response = useData(options, input, fetcherFn, swrOptions)
|
||||
return Object.assign(response, { isEmpty: true }) as WishlistResponse<Result>
|
||||
}
|
Reference in New Issue
Block a user