mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Replace useSWR with useSWRInfinite to facilitate infinite scrolling
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import useUser from '@/hooks/useUser';
|
||||
import GetUserSchema from '@/services/User/schema/GetUserSchema';
|
||||
import { createContext } from 'react';
|
||||
import { KeyedMutator } from 'swr';
|
||||
import { z } from 'zod';
|
||||
|
||||
const UserContext = createContext<{
|
||||
user?: z.infer<typeof GetUserSchema>;
|
||||
error?: unknown;
|
||||
isLoading: boolean;
|
||||
mutate?: KeyedMutator<z.infer<typeof GetUserSchema>>;
|
||||
mutate?: ReturnType<typeof useUser>['mutate']
|
||||
}>({ isLoading: true });
|
||||
|
||||
export default UserContext;
|
||||
|
||||
Reference in New Issue
Block a user