Created
February 28, 2022 16:52
-
-
Save 28development/550c317cd33a3f57a0c748530b2345c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetcher from "@/utils/fetcher"; | |
import useSWR from "swr"; | |
const useFetchAllSnippets = () => { | |
const { data, error } = useSWR("/api/snippet", fetcher); | |
return { | |
snippets: data, | |
isLoading: !error && !data, | |
isError: error | |
} | |
} | |
export default useFetchAllSnippets; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment