Refactor HostPage mapDispatchToProps to simpler object syntax & remove bindActionCreators
parent
88abfcf9ee
commit
810b750888
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue