Created
January 21, 2018 05:02
-
-
Save zettca/a4d48d38973ca5c35b44d0348385efd0 to your computer and use it in GitHub Desktop.
These are the things that keep me awake at night
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.state = ['time', 'distance', 'pace'].reduce((obj, el) => { | |
obj[el] = { value: values[el], enabled: type !== el }; | |
return obj; | |
}, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.state = { | |
time: { | |
value: values.time, | |
enabled: type !== 'time' | |
}, | |
distance: { | |
value: values.distance, | |
enabled: type !== 'distance', | |
}, | |
pace: { | |
value: values.pace, | |
enabled: type !== 'pace', | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment