import { create } from 'zustand'; import { devtools } from 'zustand/middleware'; /** * Auth State Type */ export interface AuthStateType { loggedIn: boolean; } /** * Auth Action Type */ export interface AuthActionType { setSignIn: () => void; setSignOut: () => void; } export type AuthStoreType = AuthStateType & AuthActionType; export const useAuthStore = create()( devtools( (set): AuthStoreType => ({ loggedIn: false, setSignIn: () => set(() => ({ loggedIn: true, })), setSignOut: () => set(() => ({ loggedIn: false, })), }), { name: 'auth' }, ), );