feat: 컨펌 & 얼럿 다이얼로그 스토어 생성
This commit is contained in:
@@ -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 })),
|
||||
}));
|
||||
};
|
||||
Reference in New Issue
Block a user