Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
const mapStateToProps = state => ({
hasRegisterUrl: !!getRegisterUrl(state),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
fetchRegisterUrl: () => dispatch(fetchRegisterUrl()),
goBackHistory: number => dispatch(goBackHistory(number)),
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
*/
const mapStateToProps = state => ({
isLoading: isViewLoading(state, LOGIN_PATH),
isDisabled: isUserLoginDisabled(state),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
login: credentials => dispatch(login(credentials)),
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
const mapStateToProps = (state, props) => ({
categories: getCurrentCategories(state, props),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
getCategory(categoryId) {
dispatch(getCategory(hex2bin(categoryId)));
},
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @param {Object} props The current component props.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = (dispatch, props) => ({
disableNavigator: () => dispatch(disableNavigator()),
enableNavigator: () => dispatch(enableNavigator()),
getProductImages: () => {
const productId = hex2bin(props.params.productId);
dispatch(fetchProductImages(productId));
},
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
availableFilters: getAvailableFilters(state, props),
temporaryFilters: state.filter.temporaryFilters,
queryParams: getQueryParamsAsString(state),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
mergeTemporaryFilters: temporaryFilters => dispatch(mergeTemporaryFilters(temporaryFilters)),
removeTemporaryFilter: (id, index = null) => dispatch(removeTemporaryFilter(id, index)),
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
import connect from '@shopgate/pwa-common/components/Router/helpers/connect';
import goBackHistory from '@shopgate/pwa-common/actions/history/goBackHistory';
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
goBackHistory: number => dispatch(goBackHistory(number)),
});
export default connect(null, mapDispatchToProps, null, { withRef: true });
const mapStateToProps = state => ({
configs: state.page,
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
getPageConfig: (pageId) => {
dispatch(getPageConfig(pageId));
},
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
import connect from '@shopgate/pwa-common/components/Router/helpers/connect';
import goBackHistory from '@shopgate/pwa-common/actions/history/goBackHistory';
import fetchCheckoutUrl from '@shopgate/pwa-common-commerce/checkout/actions/fetchCheckoutUrl';
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
fetchCheckoutUrl: () => dispatch(fetchCheckoutUrl()),
goBackHistory: number => dispatch(goBackHistory(number)),
});
export default connect(null, mapDispatchToProps, null, { withRef: true });
currentAttribute: getCurrentFilterAttribute(state),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
mergeTemporaryFilters: temporaryFilters => dispatch(mergeTemporaryFilters(temporaryFilters)),
setFilterAttributeClosed: () => dispatch(setFilterAttributeClosed()),
setFilterAttributeOpened: () => dispatch(setFilterAttributeOpened()),
removeTemporaryFilter: (...args) => dispatch(removeTemporaryFilter(...args)),
});
export default connect(mapStateToProps, mapDispatchToProps, null, { withRef: true });
const mapStateToProps = state => ({
isIos: isIos(state),
isLoading: isCurrentViewLoading(state),
isVisible: hasCouponSupport(state),
});
/**
* Connects the dispatch function to a callable function in the props.
* @param {Function} dispatch The redux dispatch function.
* @return {Object} The extended component props.
*/
const mapDispatchToProps = dispatch => ({
addCoupon: couponId => dispatch(addCouponsToCart([couponId])),
});
export default connect(mapStateToProps, mapDispatchToProps);