import { connect } from 'react-redux' ; import { AppState } from '../index' ; import ItemListPage from '../pages/ItemListPage' ; import { fetchTimelineAction } from '../actions/fetchTimelineAction' ; const mapStateToProps = ( state ) => { return { items : state . timeline . items , hasNext : state . timeline . hasNext , errorType : state . error . errorType , loading : state . page . isTimelineLoading , } ; } ; const mapDispatchToProps = ( dispatch ) => ( { load : ( ) => { dispatch ( fetchTimelineAction ( ) ) ; } , loadMore : ( createdAt , itemId , page ) => { dispatch ( fetchTimelineAction ( createdAt , itemId ) ) ; } , } ) ; export default connect ( mapStateToProps , mapDispatchToProps ) ( ItemListPage ) ;