@athosws/react-components
Version:
This is a set of useful ReactJS components developed by Athos.\n Email:ladiesman217.as@gmail.com
28 lines (20 loc) • 637 B
text/typescript
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { ATHOSMenuProps } from "../../interfaces";
export type WithId<T> = T & { id?: string };
const initialState: ATHOSMenuProps = {
options: [],
};
const Slice = createSlice({
name: "AMProps",
initialState,
reducers: {
fillProps: (state, action: PayloadAction<ATHOSMenuProps>) => {
const payload = action.payload;
return { ...state, ...payload };
},
},
});
// Action creators are generated for each case reducer function
export const { fillProps } = Slice.actions;
const AMPropsReducer = Slice.reducer;
export default AMPropsReducer;