canjs / can-observe

Observable objects
https://canjs.com/doc/can-observe.html
MIT License
20 stars 2 forks source link

Observable prototype breaks inheritance #81

Closed phillipskevin closed 5 years ago

phillipskevin commented 5 years ago

Something like this doesn't work:

function Obj() {}
Obj.prototype = makePrototype.observable(Object.create(Obj.prototype), {
    observe: makePrototype.observable
});
Obj.prototype.aFunction = function() {};
var o = new Obj();

o.aFunction(); // o.aFunction is undefined
phillipskevin commented 5 years ago

We are not going to handle this. can-observable-mixin is being used for what makePrototype.observable was originally intended for.