Colocate reducers, actions and selectors
This commit is contained in:
parent
1e7d4c3fe4
commit
889e3b88b7
53 changed files with 1031 additions and 914 deletions
|
@ -1,8 +1,9 @@
|
|||
import React, { PureComponent } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import Navicon from '../components/Navicon';
|
||||
import FileInput from '../components/FileInput';
|
||||
import { setCert, setKey, uploadCert } from '../actions/settings';
|
||||
import { getSettings, setCert, setKey, uploadCert } from '../state/settings';
|
||||
|
||||
class Settings extends PureComponent {
|
||||
handleCertChange = (name, data) => this.props.dispatch(setCert(name, data));
|
||||
|
@ -40,6 +41,8 @@ class Settings extends PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
export default connect(state => ({
|
||||
settings: state.settings
|
||||
}))(Settings);
|
||||
const mapState = createStructuredSelector({
|
||||
settings: getSettings
|
||||
});
|
||||
|
||||
export default connect(mapState)(Settings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue