{"size": 277, "ext": "js", "max_stars_repo_path": "hooks/feed.js", "max_stars_repo_name": "nsantini/perihelion", "max_stars_repo_stars_event_min_datetime": "2022-03-30T06:49:03.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T13:16:59.000Z", "max_issues_repo_path": "hooks/feed.js", "max_issues_repo_name": "nsantini/perihelion", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "hooks/feed.js", "max_forks_repo_name": "nsantini/perihelion", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.7857142857, "max_line_length": 71, "alphanum_fraction": 0.6281588448}
import useSWR from "swr";
import fetcher from "./utils/fetcher";

export default function useFeed(hops) {
  const { data, error, mutate } = useSWR(`/api/feed/${hops}`, fetcher);

  return {
    feed: data,
    isLoading: !error && !data,
    isError: error,
    mutate,
  };
}
