Skip to content
Permalink
1f54fc938f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
23 lines (22 sloc) 604 Bytes
import { createSlice } from "@reduxjs/toolkit";
const initialState = {
courseSelectedDetails: {},
myCourseList: [{}],
};
const profileSlice = createSlice({
name: "courseSelected",
initialState,
reducers: {
addCourseDetails(state, action) {
state.courseSelectedDetails = { ...action?.payload };
},
addToMyCourse(state, action) {
state.myCourseList = {
...state,
myCourseList: [...state?.myCourseList, action?.payload],
};
},
},
});
export const { addCourseDetails, addToMyCourse } = profileSlice.actions;
export default profileSlice.reducer;