Skip to content
Snippets Groups Projects
Commit 815fe9aa authored by Gabriel Clark's avatar Gabriel Clark
Browse files

Updated slice reducers to modern rtk syntax.

parent ba3437c7
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,7 @@ const numberInputFieldSlice = createSlice({ ...@@ -8,10 +8,7 @@ const numberInputFieldSlice = createSlice({
reducers: { reducers: {
setNumberOfUnits: (state, action) => { setNumberOfUnits: (state, action) => {
const numToConvert = action.payload; const numToConvert = action.payload;
return { state.numberToConvert = numToConvert;
...state,
numberToConvert: numToConvert,
};
}, },
}, },
}); });
......
...@@ -10,17 +10,11 @@ const unitSelectorSlice = createSlice({ ...@@ -10,17 +10,11 @@ const unitSelectorSlice = createSlice({
// The action payload should have the unit to switch to with the in or out // The action payload should have the unit to switch to with the in or out
setCurrentInputUnit: (state, action) => { setCurrentInputUnit: (state, action) => {
const newUnit = action.payload; const newUnit = action.payload;
return { state.currentInputUnit = newUnit;
...state,
currentInputUnit: newUnit,
};
}, },
setCurrentOutputUnit: (state, action) => { setCurrentOutputUnit: (state, action) => {
const newUnit = action.payload; const newUnit = action.payload;
return { state.currentOutputUnit = newUnit;
...state,
currentOutputUnit: newUnit,
};
}, },
}, },
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment