blob: bc01be7f1c9fd362f2155f37800d3b86285d3ecc (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import { useQuery } from 'react-query'
import blogApi from '../api/blogApi'
const useBlog = ({ id }) => {
const fetchBlog = async () => await blogApi({ id })
const blog = useQuery(`blog-${id}`, fetchBlog)
return { blog }
}
export default useBlog
|