Exercise Solution: Bank Application
Explore implementing Redux state updates in a bank application exercise. Learn how actions and reducers work together to modify state effectively, gaining practical experience with Redux concepts.
We'll cover the following...
We'll cover the following...
Let’s implement the two tasks from the last section.
Solution:
const reducer = (state, action) => {
switch (action.type) {
case "WITHDRAW":
return {
...state,
totalAmount: state.totalAmount - action.payload
};
default:
return state;
}
};
export default reducer;Through the ...