Skip to content

Instantly share code, notes, and snippets.

@whisher
Created January 3, 2021 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whisher/82e165ede8b98583c6c3f9243b9a20e5 to your computer and use it in GitHub Desktop.
Save whisher/82e165ede8b98583c6c3f9243b9a20e5 to your computer and use it in GitHub Desktop.
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