@shopgate/engage
Version:
Shopgate's ENGAGE library.
9 lines • 725 B
JavaScript
import{connect}from'react-redux';import{getProductRating}from'@shopgate/pwa-common-commerce/product/selectors/product';/**
* @param {Object} state The current application state.
* @param {Object} props The component props.
* @return {Object} The extended component props.
*/var mapStateToProps=function mapStateToProps(state,props){return{rating:getProductRating(state,props)};};/**
* @param {Object} next The next component props.
* @param {Object} prev The previous component props.
* @return {boolean}
*/var areStatePropsEqual=function areStatePropsEqual(next,prev){if(!prev.rating&&next.rating){return false;}return true;};export default connect(mapStateToProps,null,null,{areStatePropsEqual:areStatePropsEqual});