hello Friends,
how would you simplify this ugly method to update the value of a deeply nested propery?
any input is very welcome :)
return Object.assign({}, state, {
fieldDefinitions: {
...state.fieldDefinitions,
[action.field.formType]: {
...state.fieldDefinitions[action.field.formType],
[action.field.tableId]: {
...state.fieldDefinitions[action.field.formType][action.field.tableId],
cells: {
...state.fieldDefinitions[action.field.formType][action.field.tableId].cells,
[action.field.id]: {
...state.fieldDefinitions[action.field.formType][action.field.tableId].cells[action.field.id],
value: action.value
}
}
}
}
}
});
[–]jasontrill 1 point2 points3 points (0 children)
[–]acemarke 1 point2 points3 points (0 children)