How might I add a can.compute to a can.Control instance prototype? I'm trying to pass it into the instance functions with extend, but all instances of the class share the same single instance of the compute.
can.Control.extend('App.Window', {
...
},{
...
active: can.compute(true, function(newVal, oldVal) {
return !!newVal;
})
});
var a = new App.Window,
b = new App.Window;
a.active === b.active // true
a.active() // true
a.active(false)
a.active() // false
b.active() // false
Obviously I could just do this in the init function, but I'd rather not, so as I inherit from this in the future, I won't have to remember to call the parent init. Just hoping someone has a better way.