@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 779 B
JavaScript
import*as Redux from'redux';import{connect}from'react-redux';import{updateProductsInCart}from'@shopgate/engage/cart';import{fetchProductLocations}from"../../actions";/**
* 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{fetchProductLocations:fetchProductLocations,updateProductInCart:function updateProductInCart(cartItemId,quantity,location,fulfillmentMethod){dispatch(updateProductsInCart([{cartItemId:cartItemId,quantity:quantity,fulfillment:{method:fulfillmentMethod,location:{code:location.code,name:location.name}}}]));}};};export default connect(null,mapDispatchToProps);