@shopgate/engage
Version:
Shopgate's ENGAGE library.
3 lines • 774 B
JavaScript
import{connect}from'react-redux';import{makeGetLocation}from'@shopgate/engage/locations';/**
* @return {Function}
*/var makeMapStateToProps=function makeMapStateToProps(){var getLocation=makeGetLocation(function(_,props){return props.locationCode;});return function(state,props){var _lineItems$find;var _props$order$lineItem=props.order.lineItems,lineItems=_props$order$lineItem===void 0?[]:_props$order$lineItem;var locationCode=(_lineItems$find=lineItems.find(function(lineItem){return(lineItem===null||lineItem===void 0?void 0:lineItem.fulfillmentLocationCode)!==undefined;}))===null||_lineItems$find===void 0?void 0:_lineItems$find.fulfillmentLocationCode;return{location:getLocation(state,{locationCode:locationCode})};};};export default connect(makeMapStateToProps);