Open christopherjbaker opened 6 years ago
This works with the constructor function pattern. It doesn’t work with classes because there’s no hook to proxy the returned class.
Oh, that makes sense. Would it be as simple as observing the class itself then?
class Foo extends ObserveObject {}
export default observe(Foo)
Would this create a conflict on the instances? If so, would this be better?
class Foo {}
export default observe(Foo);
It might work both ways. I know classes have some weird restrictions like you can't change their prototype
object.
Instance properties are observed properly, but class properties are not. Using the decorators does not work. I think fixing the observability of class properties would make the decorators work too.
It would be very nice if this could be supported. =]