Closed m-mujica closed 6 years ago
@justinbmeyer the dependency graph of the getter in an array is kinda interesting (this is from the over21
getter example):
over21 makes sense to me.
though should it be Person{}.age 6
? Is the constructor named?
@justinbmeyer The code I used to render that graph is
var People = ObserveArray.extend(
"People",
{},
{
get over21() {
return this.filter(function(person) {
return person.age > 21;
});
}
}
);
var people = new People([
{ id: 1, age: 22 },
{ id: 2, age: 21 },
{ id: 3, age: 23 }
]);
That's why there are no Person
instances in the graph; if I wrap the objects in the People array with a Person
class I do get the right labels:
I think it's all fine, let me know if you disagree.
I'm going to merge and release 💥