UNPKG

@athosws/react-components

Version:

This is a set of useful ReactJS components developed by Athos.\n Email:ladiesman217.as@gmail.com

24 lines (18 loc) 628 B
import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { ATHOSSwitcherProps } from "../../interfaces"; const initialState: ATHOSSwitcherProps = { switchs: [], }; const Slice = createSlice({ name: "ATHOSSwitcherProps", initialState, reducers: { setATHOSSwitcherProps: (state, action: PayloadAction<ATHOSSwitcherProps>) => { return { ...state, ...action.payload }; }, }, }); // Action creators are generated for each case reducer function export const { setATHOSSwitcherProps } = Slice.actions; const ATHOSSwitcherPropsReducer = Slice.reducer; export default ATHOSSwitcherPropsReducer;