Improve perf with mapStateToProps scoping

This commit is contained in:
Jordan Eldredge 2017-10-22 11:10:37 -07:00
parent e589edca77
commit d2eb18fb1f
2 changed files with 6 additions and 2 deletions

View file

@ -12,4 +12,6 @@ const MonoStereo = props => (
</div>
);
export default connect(state => state.media)(MonoStereo);
export default connect(state => ({ channels: state.media.channels }))(
MonoStereo
);

View file

@ -21,7 +21,9 @@ const Volume = props => (
/>
);
const mapStateToProps = state => state.media;
const mapStateToProps = state => ({
volume: state.media.volume
});
const mapDispatchToProps = dispatch => ({
showMarquee: () => dispatch({ type: SET_FOCUS, input: "volume" }),