...

/

Exercise Solution: Bank Application

Exercise Solution: Bank Application

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 ...