From e9b9cd2cd88e453a3a35cf3f672ba965660b9ff2 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Wed, 31 Aug 2022 12:31:25 -0400 Subject: Update the dashboard with a message about the lack of any dashboards --- src/useFetch.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/useFetch.js (limited to 'src/useFetch.js') diff --git a/src/useFetch.js b/src/useFetch.js deleted file mode 100644 index d098e2f..0000000 --- a/src/useFetch.js +++ /dev/null @@ -1,17 +0,0 @@ -import { useEffect, useState } from "react"; - -export default function useFetch(url, options) { - const [data, setData] = useState(null); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - - useEffect(() => { - fetch(url, options) - .then((resp) => resp.json()) - .then((resp) => setData(resp)) - .catch((err) => setError(err)) - .finally(() => setLoading(false)); - }, []); - - return { data, loading, error }; -} -- cgit v1.2.3