blob: cfaa3d9ce224d42851e39623bd4adcbec41a68d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import categoryHomeApi from '../api/categoryHomeApi'
import { useQuery } from 'react-query'
const useCategoryHome = ({ id }) => {
const fetchCategoryHome = async () => await categoryHomeApi({ id })
const { isLoading, data } = useQuery(`categoryHome-${id}`, fetchCategoryHome)
return {
categoryHome: { data, isLoading }
}
}
export default useCategoryHome
|