ca-mfe-page-scoring-ui
Version:
This is a react shell for the SPGI Platform MFE implementation
39 lines (35 loc) • 1.1 kB
text/typescript
import { createSlice } from '@reduxjs/toolkit';
export const sizeAdjustmentSlice = createSlice({
name: 'sizeAdjustments',
initialState: {
sizeAdjustments: {},
sizeAdjSections: {
totalRevenue: true,
totalAssets: false,
totalEmployees: false
},
lastSelection: null
},
reducers: {
fetchSizeAdjustments: (state, action) => {
const { payload } = action;
state.sizeAdjustments.originalResp = payload;
state.sizeAdjustments.currentResp = payload;
},
updateSizeAdjustments: (state, action) => {
const { payload } = action;
state.sizeAdjustments.currentResp = payload;
},
updateSizeAdjSections: (state,action) => {
state.sizeAdjSections = action.payload;
},
updateLastSelection: (state,action) => {
state.lastSelection = action.payload;
}
}
});
export const {
fetchSizeAdjustments,
updateSizeAdjustments,
updateSizeAdjSections,updateLastSelection } = sizeAdjustmentSlice.actions;
export default sizeAdjustmentSlice.reducer;