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