summaryrefslogtreecommitdiff
path: root/src/common/stores/useAuthStore.ts
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-11-09 15:40:16 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-11-09 15:40:16 +0700
commitbe0f537dc4fe384eef09436833c6407e6482c16d (patch)
tree194b1ad3f34396cb8149075bbbd38b854aedf361 /src/common/stores/useAuthStore.ts
parent5d5401ae36e7e0c8eb38ccd943c1aa44a9573d35 (diff)
Initial commit
Diffstat (limited to 'src/common/stores/useAuthStore.ts')
-rw-r--r--src/common/stores/useAuthStore.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/stores/useAuthStore.ts b/src/common/stores/useAuthStore.ts
new file mode 100644
index 0000000..b88cf0b
--- /dev/null
+++ b/src/common/stores/useAuthStore.ts
@@ -0,0 +1,15 @@
+import { create } from "zustand";
+import { Credential } from "../types/auth";
+
+type State = {
+ credentials: Credential | null | undefined;
+};
+
+type Action = {
+ setCredentials: (credentials: Credential | null) => void;
+};
+
+export const useAuthStore = create<State & Action>((set) => ({
+ credentials: null,
+ setCredentials: (credentials) => set({ credentials }),
+}));