Skip to content

Instantly share code, notes, and snippets.

@ms314006
Created July 16, 2023 08:21
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 ms314006/901e6b7da2ee981a52d3d2d66e43ffa6 to your computer and use it in GitHub Desktop.
Save ms314006/901e6b7da2ee981a52d3d2d66e43ffa6 to your computer and use it in GitHub Desktop.
const useUserProfile = (userId) => useQuery({
  queryKey: ['user'],
 queryFn: async () => {
 const userProfile = await fetchUserProfile();
  return new User(userProfile);
  },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment