complated project
This commit is contained in:
16
screens/auth/login/lib/hook.ts
Normal file
16
screens/auth/login/lib/hook.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
type State = {
|
||||
token: string | null;
|
||||
};
|
||||
|
||||
type Actions = {
|
||||
savedToken: (token: string | null) => void;
|
||||
};
|
||||
|
||||
const useTokenStore = create<State & Actions>((set) => ({
|
||||
token: null,
|
||||
savedToken: (token: string | null) => set(() => ({ token })),
|
||||
}));
|
||||
|
||||
export default useTokenStore;
|
||||
Reference in New Issue
Block a user