production-taskbar-client / src / renderer / features / info / notification_bar / notificationSlice.js
notificationSlice.js
Raw
import { createSlice } from "@reduxjs/toolkit";

export const notificationSlice = createSlice({
  name: "notification",
  initialState: {
    notice: { title: "", text: "", event: "", type: "", progress: 0 },
  },
  reducers: {
    setNotice: (state, action) => {
      state.notice = action.payload;
    },
    clearNotice: (state) => {
      state.notice = { title: "", text: "", event: "", type: "", progress: 0 };
    },
  },
});

export const { setNotice, clearNotice } = notificationSlice.actions;

export default notificationSlice.reducer;