PlusMinusSet

This commit is contained in:
2025-06-23 17:07:56 +02:00
commit ecef7ec9f1
16 changed files with 3397 additions and 0 deletions

17
lab07/src/reducer.js Normal file
View File

@ -0,0 +1,17 @@
const initialState = {
count: 100,
fifeTHousend: 5000,
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case "count/increaseBy":
return { ...state, count: state.count + action.amount };
case "count/decreaseBy":
return { ...state, count: state.count - action.amount };
case "count/setToFiveThousand":
return { ...state, count: state.fifeTHousend };
default:
return state;
}
}