Something went wrong. Try again.
A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';import { authApi } from '../api';
export function useCurrentUser() { return useQuery({ queryKey: ['user'], queryFn: authApi.getCurrentUser, retry: false, });}
export function useUserRepos() { return useQuery({ queryKey: ['userRepos'], queryFn: authApi.getUserRepos, retry: false, });}
export function useLogout() { const queryClient = useQueryClient();
return useMutation({ mutationFn: authApi.logout, onSuccess: () => { queryClient.clear(); window.location.href = '/'; }, });}