Refactor HostPage mapDispatchToProps to simpler object syntax & remove bindActionCreators
parent
88abfcf9ee
commit
810b750888
|
@ -1,7 +1,6 @@
|
||||||
import React, {Component} from 'react'
|
import React, {Component} from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
import {bindActionCreators} from 'redux'
|
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
|
@ -234,7 +233,7 @@ HostPage.propTypes = {
|
||||||
handleClickPresentationButton: func,
|
handleClickPresentationButton: func,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mstp = ({
|
||||||
app: {
|
app: {
|
||||||
ephemeral: {inPresentationMode},
|
ephemeral: {inPresentationMode},
|
||||||
persisted: {autoRefresh},
|
persisted: {autoRefresh},
|
||||||
|
@ -244,14 +243,9 @@ const mapStateToProps = ({
|
||||||
autoRefresh,
|
autoRefresh,
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mdtp = {
|
||||||
handleChooseAutoRefresh: bindActionCreators(setAutoRefresh, dispatch),
|
handleChooseAutoRefresh: setAutoRefresh,
|
||||||
handleClickPresentationButton: bindActionCreators(
|
handleClickPresentationButton: delayEnablePresentationMode,
|
||||||
delayEnablePresentationMode,
|
}
|
||||||
dispatch
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(
|
export default connect(mstp, mdtp)(ManualRefresh(HostPage))
|
||||||
ManualRefresh(HostPage)
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue