We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9350f4 commit e092d00Copy full SHA for e092d00
src/stores/loginInfo.store.ts
@@ -0,0 +1,22 @@
1
+import { create } from 'zustand';
2
+import { persist } from 'zustand/middleware';
3
+
4
+import { Authenticated, Registration } from '@type/models';
5
6
+type LoginInfo = Authenticated | Registration;
7
+type LoginInfoState = {
8
+ loginInfo: LoginInfo | null;
9
+ setLoginInfo: (loginInfo: LoginInfo | null) => void;
10
+};
11
12
+export const useLoginInfoStore = create(
13
+ persist<LoginInfoState>(
14
+ (set) => ({
15
+ loginInfo: null,
16
+ setLoginInfo: (loginInfo) => set({ loginInfo }),
17
+ }),
18
+ {
19
+ name: 'LOGIN_INFO_PERSIST',
20
+ }
21
+ )
22
+);
0 commit comments