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

export const userdataSlice = createSlice({
  name: "user",
  initialState: {
    user: {},
  },
  reducers: {
    setUser: (state, action) => {
      state.user = action.payload;
    },
  },
  selectors: {
    selectUser: (state) => state.user,
  },
});

export const { setUser } = userdataSlice.actions;
export const { selectUser } = userdataSlice.selectors;

export default userdataSlice.reducer;
