I am passing an object to a function. I want to destructure some of the child object, but also have a reference to the original parent object. I hope this illustrates what I mean :
let state = {
objectA: {},
objectB: {},
objectC: {}
}
const mapStateToProps = ({ objectA, objectB}, state) => {
let a = objectA;
let b = objectB;
let c = state.objectC;
};
mapStateToProps(state);
I want to be able to destructure some of the objects, but then also have a reference to the original state object.
Is it possible to do this ?