@shopgate/engage
Version:
Shopgate's ENGAGE library.
6 lines • 1.1 kB
JavaScript
import{connect}from'react-redux';import{getShopSettings,getConfigFetching}from'@shopgate/engage/core/config';import{getNumberOfAddressLines,getRegistrationMode}from'@shopgate/engage/core';import{hasDirectShipItems}from'@shopgate/engage/cart';import{getPreferredLocationAddress}from'@shopgate/engage/locations/selectors';import{getMerchantCustomerAttributes}from'@shopgate/engage/core/selectors/merchantSettings';import{submitRegistration}from"./RegistrationProvider.actions";/**
* @returns {Function}
*/function makeMapStateToProps(){/**
* @param {Object} state The application state.
* @returns {Object}
*/return function(state){return{isDataReady:!getConfigFetching(state),shopSettings:getShopSettings(state),userLocation:getPreferredLocationAddress(state),customerAttributes:getMerchantCustomerAttributes(state),cartHasDirectShipItems:hasDirectShipItems(state),numberOfAddressLines:getNumberOfAddressLines(state),registrationMode:getRegistrationMode(state)};};}var mapDispatchToProps={submitRegistration:submitRegistration};export default connect(makeMapStateToProps,mapDispatchToProps);