I'd like to use the property dependencies to avoid dirty checking on computed properties. Since the properties on which the computed property depends are no primitives but attributes of an object I don't know how to make this work.
Code:
import {computedFrom} from 'aurelia-framework';
export class Person {
personData = {
firstName: 'John',
lastName: 'Doe',
// More attributes...
}
// ...
// Doesn't work:
@computedFrom('personData.firstName', 'personData.lastName')
// Neither does:
// @computedFrom('personData["firstName"], 'personData["lastName"]')
// Nor:
// @computedFrom('personData')
get fullName() {
return `${this.personData.firstName} ${this.personData.lastName}`;
}
// ...
}