UNPKG

@shopgate/engage

Version:
10 lines 767 B
import{connect}from'react-redux';import{getProductPriceData}from'@shopgate/pwa-common-commerce/product';/** * Maps the contents of the state to the component props. * @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{price:getProductPriceData(state,props)};};/** * @param {Object} next The next component props. * @param {Object} prev The current component props. * @return {boolean} */var areStatePropsEqual=function areStatePropsEqual(next,prev){if(!prev.price&&next.price){return false;}return true;};export default connect(mapStateToProps,null,null,{areStatePropsEqual:areStatePropsEqual});