From 810b75088833223754dbc8389633472b8acf2bc0 Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Mon, 25 Jun 2018 15:41:57 -0700 Subject: [PATCH] Refactor HostPage mapDispatchToProps to simpler object syntax & remove bindActionCreators --- ui/src/hosts/containers/HostPage.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/ui/src/hosts/containers/HostPage.js b/ui/src/hosts/containers/HostPage.js index 7389bc894d..6205e81d16 100644 --- a/ui/src/hosts/containers/HostPage.js +++ b/ui/src/hosts/containers/HostPage.js @@ -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))