forked from crowetic/commerce
Removed use-action helper
This commit is contained in:
parent
683794bb33
commit
4b4d804d03
@ -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]
|
|
||||||
)
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user