@shopgate/engage
Version:
Shopgate's ENGAGE library.
9 lines • 766 B
JavaScript
import{connect}from'react-redux';import{historyPush}from'@shopgate/engage/core';import{fetchOrderHistory}from"../actions";import{getOrders,getTotalOrderCount}from"../selectors";/**
* @param {Object} state The application state.
* @param {Object} props The component props.
* @returns {Object}
*/var mapStateToProps=function mapStateToProps(state){return{orders:getOrders(state),totalOrderCount:getTotalOrderCount(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.
*/var mapDispatchToProps={fetchOrderHistory:fetchOrderHistory,historyPush:historyPush};export default connect(mapStateToProps,mapDispatchToProps);