@shopgate/engage
Version:
Shopgate's ENGAGE library.
9 lines • 926 B
JavaScript
import{connect}from'react-redux';import{makeGetProductEffectivityDates,productNotAvailable as _productNotAvailable,NOT_AVAILABLE_EFFECTIVITY_DATES}from'@shopgate/engage/product';/**
* Create exclusive component selector.
* @returns {Function}
*/function makeMapStateToProps(){var getProductEffectivityDates=makeGetProductEffectivityDates();return function(state,props){return{dates:getProductEffectivityDates(state,props)};};}/**
* Maps the contents of the state to the component props.
* @param {Function} dispatch The dispatch method from the store.
* @param {Object} props The props.
* @return {Object} The extended component props.
*/var mapDispatchToProps=function mapDispatchToProps(dispatch,props){return{productNotAvailable:function productNotAvailable(){return dispatch(_productNotAvailable(props.productId,NOT_AVAILABLE_EFFECTIVITY_DATES));}};};export default connect(makeMapStateToProps,mapDispatchToProps);