Refactor HostPage mapDispatchToProps to simpler object syntax & remove bindActionCreators

pull/10616/head
Jared Scheib 2018-06-25 15:41:57 -07:00
parent 88abfcf9ee
commit 810b750888
1 changed files with 6 additions and 12 deletions

View File

@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import _ from 'lodash'
import classnames from 'classnames'
@ -234,7 +233,7 @@ HostPage.propTypes = {
handleClickPresentationButton: func,
}
const mapStateToProps = ({
const mstp = ({
app: {
ephemeral: {inPresentationMode},
persisted: {autoRefresh},
@ -244,14 +243,9 @@ const mapStateToProps = ({
autoRefresh,
})
const mapDispatchToProps = dispatch => ({
handleChooseAutoRefresh: bindActionCreators(setAutoRefresh, dispatch),
handleClickPresentationButton: bindActionCreators(
delayEnablePresentationMode,
dispatch
),
})
const mdtp = {
handleChooseAutoRefresh: setAutoRefresh,
handleClickPresentationButton: delayEnablePresentationMode,
}
export default connect(mapStateToProps, mapDispatchToProps)(
ManualRefresh(HostPage)
)
export default connect(mstp, mdtp)(ManualRefresh(HostPage))