Vercel/src/state/index.ts
Sam Becker df11a86181 Init
2023-09-05 09:00:57 -05:00

16 lines
519 B
TypeScript

import { createContext, useContext } from 'react';
import { AnimationConfig } from '@/components/AnimateItems';
export interface AppStateContext {
previousPathname?: string
hasLoaded?: boolean
setHasLoaded?: (hasLoaded: boolean) => void
nextPhotoAnimation?: AnimationConfig
setNextPhotoAnimation?: (animation?: AnimationConfig) => void
clearNextPhotoAnimation?: () => void
}
export const AppStateContext = createContext<AppStateContext>({});
export const useAppState = () => useContext(AppStateContext);