Closed m-mujica closed 6 years ago
var Person = DefineMap.extend({ first: "string", last: "string", fullName: { get: function() { return this.first + " " + this.last; } }, fullNameChangeCount: { stream: function() { return this.toStream(".fullName").scan(function(last) { return last + 1; }, 0); } } }); canDefineStreamKefir(Person); var me = new Person({ name: "John", last: "Doe" }); draw( document.querySelector("#container"), getGraph(me, "fullNameChangeCount") );
Generates the following dependency graph:
Note how from the the fullNameChangeCount it can see deps all the way to DefineMap.first and DefineMap.last.
fullNameChangeCount
DefineMap.first
DefineMap.last
Generates the following dependency graph:
Note how from the the
fullNameChangeCount
it can see deps all the way toDefineMap.first
andDefineMap.last
.