@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 631 B
JavaScript
import{connect}from'react-redux';import updateProductsInCart from'@shopgate/pwa-common-commerce/cart/actions/updateProductsInCart';/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{setSubstitutionAllowed:function setSubstitutionAllowed(cartItemId,substitutionAllowed){return dispatch(updateProductsInCart([{cartItemId:cartItemId,substitutionAllowed:substitutionAllowed}]));}};};export default connect(null,mapDispatchToProps);