@shopgate/engage
Version:
Shopgate's ENGAGE library.
18 lines (17 loc) • 640 B
JavaScript
import { connect } from 'react-redux';
import { getIsBackInStockEnabled, makeGetSubscriptionByProduct } from '@shopgate/engage/back-in-stock/selectors';
import { getProduct } from '@shopgate/engage/product';
/**
* @return {Object} The extended component props.
*/
const makeMapStateToProps = () => {
const getSubscriptionByProduct = makeGetSubscriptionByProduct({
status: 'active'
});
return (state, props) => ({
subscription: getSubscriptionByProduct(state, props),
isBackInStockEnabled: getIsBackInStockEnabled(state, props),
product: getProduct(state, props)
});
};
export default connect(makeMapStateToProps);