Is there a nicer way to do this?:
const {
valueA,
valueB,
valueC,
valueD,
valueE,
valueF
} = this.state;
const newObjectWrapper = {
valueA,
valueB,
valueC,
valueD,
valueE,
valueF
};
dispatch(setNewValues(newObjectWrapper));
I'm trying to de-structure some of the items in state(not all of them, which is annoying otherwise I could just pass state) and then place them inside a new object so I can group them up before adding them to a store. Is there a nice shorter way to do this?