Files
the-biergarten-app/contexts/userContext.ts
Aaron William Po 915adb722a Implement react-intersection-observer to facilitate infinite scroll
Uses react-intersection-observer to load more comments when the last of the previously loaded comments is in the viewport.
2023-04-09 18:41:58 -04:00

14 lines
390 B
TypeScript

import useUser from '@/hooks/useUser';
import GetUserSchema from '@/services/User/schema/GetUserSchema';
import { createContext } from 'react';
import { z } from 'zod';
const UserContext = createContext<{
user?: z.infer<typeof GetUserSchema>;
error?: unknown;
isLoading: boolean;
mutate?: ReturnType<typeof useUser>['mutate'];
}>({ isLoading: true });
export default UserContext;