Reducer function that catches actions and changes/overwrites product state.
@param state current State of the redux store @param action a product action @returns product state