I’ve redux store which looks like below.
store = {
a: {
b: { value: "" }
},
c: { ... }
};
From my component, I want to pass like below to minipulate value
of b
.
dispatch(doSomething({ value: 'my-value', place: "a.b" });
And, in my reducers,
doSomething: (state, action) => {
const { value, place } = action.payload;
state[place].value = value; // here, i want to refere -> state.a.b.value = value;
}
How can I achieve it?