import { createSlice } from '@reduxjs/toolkit';

const initialState = {
  errorEvent: null,
};

export const slice = createSlice({
  name: '@@COMMON/REQUEST',
  initialState,

  reducers: {
    requestEventAction: (state) => state,
    responseEventAction: (state) => state,
    errorEventAction: (state, action) => {
      state.errorEvent = action.payload;
    },
  },
});

export const { errorEventAction, requestEventAction, responseEventAction } = slice.actions;

export default slice.reducer;
