23 lines
577 B
JavaScript
23 lines
577 B
JavaScript
import {connect} from 'react-redux'
|
|
import ItemsPage from '../components/ItemsPage'
|
|
import {toPage, getStoreList, clearItems} from '../actions'
|
|
|
|
const mapStateToProps = (state) => ({
|
|
dev: state.sys.dev,
|
|
show: state.ui.page == 1,
|
|
refresh: state.ui.loading,
|
|
list: state.sys.items || []
|
|
})
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => ({
|
|
getList: () => {
|
|
dispatch(getItems())
|
|
},
|
|
backPage: () => {
|
|
dispatch(clearItems())
|
|
dispatch(toPage(0))
|
|
dispatch(getStoreList())
|
|
}
|
|
})
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ItemsPage) |