import { connect , MapDispatchToProps , MapStateToProps } from 'react-redux' ; import { Dispatch } from 'redux' ; import ArticleVirtualList , { IArticleVirtualListDispatchProps , IArticleVirtualListOwnProps , IArticleVirtualListStateProps , } from '../components/ArticleVirtualList' ; import { asyncActionDispatcher , asyncSelectAndReadArticleAction , } from '../redux/actions' ; import { IReduxAction , IReduxState } from '../schemas' ; const mapStateToProps = ( state ) => ( { articles : state . articles . list , currentArticle : state . articles . current , selectedMenuKey : state . menu . selectedKey , } ) ; const mapDispatchToProps = ( dispatch ) => ( { selectArticle : ( id , index ) => asyncActionDispatcher ( dispatch , asyncSelectAndReadArticleAction ( id , index ) ) , } ) ; export default connect ( mapStateToProps , mapDispatchToProps ) ( ArticleVirtualList ) ;