Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- general:{duration:100,strength:100},
- gameA:{strength:50},
- gameB:{duration:50}
- }
- const mapStateToProps = (state) => {
- return {
- duration: state.general.duration,
- strength: state.general.strength
- }
- export default connect(mapStateToProps)(GameA);
- const mapStateToProps = (state) => {
- let {duration, strength} = state.general;
- if(state.gameA && state.gameA.duration) duration = state.gameA.duration;
- if(state.gameA && state.gameA.strength) strength= state.gameA.strength;
- return {
- duration: duration,
- strength: strength
- }
Add Comment
Please, Sign In to add comment