-
-
Save moui72/5ca2774faf604ef7d66192363c3b5d55 to your computer and use it in GitHub Desktop.
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
let state = { | |
..., | |
toggleables: [ | |
// propertyName: default value | |
{ visible: true }, | |
{ rankable: true } | |
], | |
... | |
} | |
let obj = {}; | |
// is there a better way to do this? | |
state.toggleables.forEach(p => { | |
_.forOwn(p, (val, key) => { | |
obj[key] = val; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment