feat: 컨펌 & 얼럿 다이얼로그 스토어 생성

This commit is contained in:
2025-03-19 15:54:20 +09:00
parent 25a2ac5716
commit 6f0e1a6e40
7 changed files with 120 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
import { createStore } from "zustand/vanilla";
export type AlertState = {
alertMessage: string;
};
export type AlertActions = {
setAlertMessage: (message: string) => void;
};
export type AlertStore = AlertState & AlertActions;
export const defaultInitState: AlertState = {
alertMessage: "",
};
export const createAlertStore = (initState: AlertState = defaultInitState) => {
return createStore<AlertStore>()((set) => ({
...initState,
setAlertMessage: (alertMessage: string) => set(() => ({ alertMessage })),
}));
};