mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-21 20:21:32 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
21
apps/client/src/stores/auth.ts
Normal file
21
apps/client/src/stores/auth.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { UserDto } from "@reactive-resume/dto";
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
|
||||
interface AuthState {
|
||||
user: UserDto | null;
|
||||
}
|
||||
|
||||
interface AuthActions {
|
||||
setUser: (user: UserDto | null) => void;
|
||||
}
|
||||
|
||||
export const useAuthStore = create<AuthState & AuthActions>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
user: null,
|
||||
setUser: (user) => set({ user }),
|
||||
}),
|
||||
{ name: "auth" },
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user