Empty SWRhooks

This commit is contained in:
Bel Curcio
2021-06-10 17:27:50 -03:00
parent dd28712e51
commit 5ce1ee7aba
11 changed files with 172 additions and 131 deletions

View File

@@ -1,15 +1,13 @@
import { useCallback } from 'react'
import { SWRHook } from '@commerce/utils/types'
import useSearch, { UseSearch } from '@commerce/product/use-search'
export default useSearch as UseSearch<typeof handler>
export function emptyHook() {
const useEmptyHook = async (options = {}) => {
return useCallback(async function () {
return Promise.resolve()
}, [])
}
return useEmptyHook
export const handler: SWRHook<any> = {
fetchOptions: {
query: '',
},
async fetcher({ input, options, fetch }) {},
useHook: () => () => {
return {}
},
}
export const handler = {}
export default emptyHook