session context & auth util functions
This commit is contained in:
8
client/src/context/session.ts
Normal file
8
client/src/context/session.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { User } from "@chessu/types";
|
||||
|
||||
import { createContext, Dispatch, SetStateAction } from "react";
|
||||
|
||||
export const SessionContext = createContext<{
|
||||
user: User | null | undefined; // undefined = hasn't been checked yet, null = no user
|
||||
setUser: Dispatch<SetStateAction<User | null>>;
|
||||
} | null>(null);
|
||||
Reference in New Issue
Block a user