10 lines
363 B
TypeScript
10 lines
363 B
TypeScript
import { createContext } from 'preact'
|
|
import { useContext } from 'preact/hooks'
|
|
|
|
type CurrentUserContextType = { user: ANY; setUser: (user: ANY) => void }
|
|
const CurrentUserContext = createContext<CurrentUserContextType | null>(null)
|
|
|
|
export default CurrentUserContext
|
|
|
|
export const useCurrentUser = () => useContext(CurrentUserContext) as CurrentUserContextType
|