From be0f537dc4fe384eef09436833c6407e6482c16d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 9 Nov 2023 15:40:16 +0700 Subject: Initial commit --- src/common/stores/useAuthStore.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/common/stores/useAuthStore.ts (limited to 'src/common/stores/useAuthStore.ts') 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((set) => ({ + credentials: null, + setCredentials: (credentials) => set({ credentials }), +})); -- cgit v1.2.3