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

const taskCreate = createSlice({
   name: 'taskCreate',
   initialState: [],
   reducers: {
      setTaskCreate: (state, action) => {
         return action.payload;
      },
      deleteTaskCreate: (state, action) => {
         return state.filter((item: any, index: number) => index != action.payload);
      },
   },
});

export const { setTaskCreate, deleteTaskCreate } = taskCreate.actions;
export default taskCreate.reducer;