react-code-dataset / recharts /src /state /polarOptionsSlice.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
674 Bytes
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
export type PolarChartOptions = {
cx: number | string;
cy: number | string;
startAngle: number;
endAngle: number;
innerRadius: number | string;
outerRadius: number | string;
};
const polarOptionsSlice = createSlice({
name: 'polarOptions',
initialState: null as PolarChartOptions | null,
reducers: {
updatePolarOptions: (_state: PolarChartOptions, action: PayloadAction<PolarChartOptions>): PolarChartOptions => {
return action.payload;
},
},
});
export const { updatePolarOptions } = polarOptionsSlice.actions;
export const polarOptionsReducer = polarOptionsSlice.reducer;