UNPKG

@shopgate/engage

Version:
7 lines 1.03 kB
import{connect}from'react-redux';import{getBackInStockSubscriptions,getBackInStockSubscriptionsFetching,getBackInStockSubscriptionsInitial,getAreBackInStockRequestsPossible}from'@shopgate/engage/back-in-stock/selectors';import{addBackInStockSubscription,removeBackInStockSubscription}from'@shopgate/engage/back-in-stock/actions';/** * @return {Function} The extended component props. */function makeMapStateToProps(){/** * @param {Object} state The application state. * @param {Object} props The component props * @returns {Object} */return function(state,props){return{subscriptions:getBackInStockSubscriptions(state,props),isFetching:getBackInStockSubscriptionsFetching(state,props),isInitial:getBackInStockSubscriptionsInitial(state,props),requestsPossible:getAreBackInStockRequestsPossible(state,props)};};}var mapDispatchToProps={addBackInStockSubscription:addBackInStockSubscription,removeBackInStockSubscription:removeBackInStockSubscription};export default connect(makeMapStateToProps,mapDispatchToProps);