19 lines
406 B
JavaScript
19 lines
406 B
JavaScript
|
|
import { connect } from "react-redux";
|
||
|
|
import { OPTION_CHANGE } from "constants/actionTypes";
|
||
|
|
|
||
|
|
const mapStateToProps = state => {
|
||
|
|
return {
|
||
|
|
options: state.options
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
const mapDispatchToProps = dispatch => ({
|
||
|
|
onOptionChanged: option => dispatch({ type: OPTION_CHANGE, ...option })
|
||
|
|
});
|
||
|
|
|
||
|
|
export const optionchangewrapper = component =>
|
||
|
|
connect(
|
||
|
|
mapStateToProps,
|
||
|
|
mapDispatchToProps
|
||
|
|
)(component);
|