Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wealthfront-data-fetching-blog-post/2f921e130c8a659ff1c241ab769b51bb to your computer and use it in GitHub Desktop.
Save wealthfront-data-fetching-blog-post/2f921e130c8a659ff1c241ab769b51bb to your computer and use it in GitHub Desktop.
const { data: queryData } = useQuery({
queryKey: ['getUser', userId],
queryFn: () => api.getUser(userId),
onError: (e) => {
alertErrorMonitoring(e);
},
});
// vs
const { data: apiQueryData } = useApiQuery('getUser', [userId]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment