Simplify Settings mapDispatch
This commit is contained in:
parent
3209238562
commit
962f7d1eb0
File diff suppressed because one or more lines are too long
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user