import { useQuery } from 'react-query' import videoApi from '../api/videoApi' const useVideo = ({ limit, offset }) => { const fetchVideo = async () => await videoApi({ limit, offset }) const video = useQuery(`video-${limit}-${offset}`, fetchVideo, { refetchOnWindowFocus: false }) return { video } } export default useVideo