mirror of
https://github.com/vercel/commerce.git
synced 2025-07-30 05:31:22 +00:00
Removed use-action helper
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
import { useCallback } from 'react'
|
|
||||||
import type { HookFetcher, HookFetcherOptions } from './types'
|
|
||||||
import { useCommerce } from '..'
|
|
||||||
|
|
||||||
export default function useAction<T, Input = null>(
|
|
||||||
options: HookFetcherOptions,
|
|
||||||
fetcher: HookFetcher<T, Input>
|
|
||||||
) {
|
|
||||||
const { fetcherRef } = useCommerce()
|
|
||||||
|
|
||||||
return useCallback(
|
|
||||||
(input: Input) => fetcher(options, input, fetcherRef.current),
|
|
||||||
[fetcher]
|
|
||||||
)
|
|
||||||
}
|
|
Reference in New Issue
Block a user