{"size": 580, "ext": "js", "max_stars_repo_path": "libraries/commerce/reviews/action-creators/receiveReviews.js", "max_stars_repo_name": "shopg8felix/pwa", "max_stars_repo_stars_event_min_datetime": "2018-03-07T20:08:18.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-01T10:12:27.000Z", "max_issues_repo_path": "libraries/commerce/reviews/action-creators/receiveReviews.js", "max_issues_repo_name": "shopg8felix/pwa", "max_issues_repo_issues_event_min_datetime": "2018-04-18T10:35:12.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-14T07:41:23.000Z", "max_forks_repo_path": "libraries/commerce/reviews/action-creators/receiveReviews.js", "max_forks_repo_name": "shopg8felix/pwa", "max_forks_repo_forks_event_min_datetime": "2018-05-15T12:53:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-21T06:30:04.000Z"}
{"max_stars_count": 35, "max_issues_count": 435, "max_forks_count": 10, "avg_line_length": 29.0, "max_line_length": 78, "alphanum_fraction": 0.7327586207}
import { RECEIVE_REVIEWS } from '../constants';

/**
 * Dispatches the RECEIVE_REVIEWS action.
 * @param {string} hash Generated hash for an entity.
 * @param {string} productId The ID of the product.
 * @param {Array} reviews The received review data.
 * @param {number} totalReviewCount The total number of reviews for a product.
 * @returns {Object} The RECEIVE_PRODUCT_REVIEWS action.
 */
const receiveReviews = (hash, productId, reviews, totalReviewCount) => ({
  type: RECEIVE_REVIEWS,
  hash,
  productId,
  reviews,
  totalReviewCount,
});

export default receiveReviews;
