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