blob: 14ef2a0f2e122aed15371091e01ffb72c46f6760 (
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
|