UNPKG

@shopgate/engage

Version:
7 lines 754 B
import{connect}from'react-redux';import deleteCouponsFromCart from'@shopgate/pwa-common-commerce/cart/actions/deleteCouponsFromCart';import{getCurrency}from'@shopgate/pwa-common-commerce/cart/selectors';/** * @param {Object} state The current application state. * @return {Object} The extended component props. */var mapStateToProps=function mapStateToProps(state){return{currency:getCurrency(state)};};/** * @param {Function} dispatch The redux dispatch function. * @return {Object} The extended component props. */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{deleteCoupon:function deleteCoupon(couponCode){return dispatch(deleteCouponsFromCart([couponCode]));}};};export default connect(mapStateToProps,mapDispatchToProps);