Created
January 3, 2021 14:54
-
-
Save whisher/82e165ede8b98583c6c3f9243b9a20e5 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
export const fetchUser = (key: string, user: string) => | |
fetch(`https://api.github.com/users/${user}`).then((res) => res.json()); | |
export default function usePost(user: string) { | |
return useQuery(user && ["user", user], fetchUser); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment