Not sure if you are interested in just a solution within the Redux space, but since the question has a MobX label as well, here is what your object would look like in MobX, with properties that would get automatically recomputed if your React components are marked with observer:
With plain objects:
var doc = observable({
id: 1111,
revision: 5,
title: 'Lorem Ipsum',
items: [{...}, {...}]
get reference() {
return this.id + '-' + this.revision;
}
get totalQuantity() {
return thisitems.reduce(function(total, item) {
return total + item.quantity;
}, 0);
}
})
You can also use classes & decorators, or utility functions that leverage extendObservable to mix the computed properties afterwards into the objects. Selectors are not needed as MobX will track for you which data needs to be selected and reacted to.