import { useQuery } from "@tanstack/react-query";

import { wwwAXIOS } from "src/Www";

export default function useGetHit(isHitPosted: boolean) {
  return useQuery({
    enabled: isHitPosted,
    queryKey: ["hit"],
    queryFn: async () => {
      const { data } = await wwwAXIOS.get<number[]>("/hit");
      return data;
    },
    initialData: [],
  });
}
