Files
frontend/packages/rsone/components/store/alert-store.ts
T
rsone001 d9d5b49057 st: refactor:
- Real Grid 컴포넌트 @rsone/components 로 모듈화
- 컴포넌트 동적 import 경로 수정(engName -> urlPath)
2026-01-09 10:21:00 +09:00

26 lines
648 B
TypeScript

import { create } from "zustand";
export type AlertState = {
message: string;
callback?: () => void;
};
export type AlertActions = {
setMessage: (message: string, callback?: () => void) => void;
};
export type AlertStore = AlertState & AlertActions;
interface AlertStoreState extends AlertStore {}
const useAlertStoreHook = create<AlertStoreState>((set) => ({
message: "",
callback: undefined,
setMessage: (message: string, callback?: () => void) =>
set(() => ({ message, callback })),
}));
export const useAlertStore = useAlertStoreHook;
export const getAlertStoreState = () => useAlertStoreHook.getState();