import { connect , MapDispatchToProps , MapStateToProps } from 'react-redux' ; import { Dispatch } from 'redux' ; import ArticleView , { IArticleViewDispatchProps , IArticleViewOwnProps , IArticleViewStateProps , } from '../components/ArticleView' ; import { asyncActionDispatcher , asyncStarArticleAction } from '../redux/actions' ; import { IReduxAction , IReduxState } from '../schemas' ; const mapStateToProps = ( state ) => ( { articles : state . articles . list , currentArticle : state . articles . current , feedsMap : state . feeds . map , isUpdatingCurrentArticle : state . articles . isUpdatingCurrent , } ) ; const mapDispatchToProps = ( dispatch ) => ( { asyncStarArticle : ( articleId , isStarred ) => asyncActionDispatcher ( dispatch , asyncStarArticleAction ( articleId , isStarred ) ) , } ) ; export default connect ( mapStateToProps , mapDispatchToProps ) ( ArticleView ) ;