Simplify Settings mapDispatch

This commit is contained in:
Ken-Håvard Lieng 2017-06-29 07:11:12 +02:00
parent 3209238562
commit 962f7d1eb0
2 changed files with 24 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,3 @@
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect'; import { createStructuredSelector } from 'reselect';
import Settings from 'components/pages/Settings'; import Settings from 'components/pages/Settings';
@ -8,10 +7,10 @@ const mapState = createStructuredSelector({
settings: getSettings settings: getSettings
}); });
const mapDispatch = dispatch => ({ const mapDispatch = {
onCertChange(name, data) { dispatch(setCert(name, data)); }, onCertChange: setCert,
onKeyChange(name, data) { dispatch(setKey(name, data)); }, onKeyChange: setKey,
...bindActionCreators({ uploadCert }, dispatch) uploadCert
}); };
export default connect(mapState, mapDispatch)(Settings); export default connect(mapState, mapDispatch)(Settings);